Mendeleev, his element cards, and the dream story
Where the famous story of the periodic table appearing in a dream comes from, and the years of work behind it.
Laying out the element cards
In February 1869, the Russian chemist Dmitri Mendeleev was writing a chemistry textbook and puzzling over how to order the sixty or so elements then known. He reportedly wrote each element's name, atomic weight and properties on a card, spread the cards across his desk and kept rearranging them, almost like a game of solitaire.
Where the dream story comes from
The claim that the periodic table came to him complete in a dream does not come from Mendeleev's own writing. It comes from the recollection of his colleague, the geologist Alexander Inostrantsev: Mendeleev saw a table with every element in place, woke, wrote it down, and later needed only one correction. Historians do not treat this as established fact and see years of collecting and comparing data as the real foundation.
The true power of Mendeleev's table lay in its gaps. He left spaces for elements not yet discovered and predicted their properties. When gallium, scandium and germanium were later found, his predictions were confirmed.
What intuition did
Dream or not, the moment things fall into place usually comes after enough material has piled up in the mind. Sleep is known to play a role in consolidating what we learned during the day, so "I slept on it and the answer came" is not a baseless experience.
Sources: Mendeleev's 1869 periodic table; Inostrantsev's recollection as quoted in biographies of Mendeleev.