Everything (even us) is made of atoms. By about 1800, scientists had discovered about 40 elements (or different types of atom), and knew some of their properties. Then scientists started looking for patterns - because that's what scientists do!
The first scientist to get anywhere with this problem was Johann Wolfgang Döbereiner. He noticed that the known elements mostly fitted into groups of three. The groups of three had similar properties, and each group of three had a light element, a heavy element and one with a middle weight. Döbereiner called his groups of three, triads (tri means three - as in triangle). For example, lithium, sodium and potassium were a triad of metals which reacted violently with water.
The next scientist in this story was John Newlands. He wrote about a Law of Octaves (oct means eight - as in octopus). He took the elements known at the time, and ordered them from lightest to heaviest. Some of the time, similar elements appeared every eighth position. This picture shows how that worked - the elements are sorted into order from light to heavy, and similar elements have been highlighted in bright colours.
Then came the key person in this story - Russian scientist Dimitri Mendeleev. He had two ideas which might seem obvious now, but were revolutionary at the time.
Firstly, he said that there might be elements which exist that haven't been discovered yet. So leave gaps if it helps to make the patterns work better.
Secondly, he said that when the patterns (like the octaves) work better if pairs of elements are swapped round, then swap them.
The really impressive thing about Mendeleev's idea for the periodic table was that the gaps in the table were predictions of new elements to discover. The patterns in the table helped Mendeleev to predict what these elements would be like. After the periodic table was published, scientists looked for the missing elements. They all appeared, and had the properties which Mendeleev had predicted.
A few decades later, a British chemist, Henry Moseley, realised that it would be better to use atomic number rather than mass, so he put the final touches to the periodic table. This resolved some issues that had surfaced from Mendeleev's work.
The periodic table, as we know it today, is shown below. The different colours show elements with similar characteristics. They sit in columns- these are the triads of Döbereiner (except the groups have more than three in them now), and repeat as Newlands' octaves (for the first few rows, anyway). The crucial ideas to make the periodic table work came from Mendeleev.
Let's move on to some questions now.