He lined them up according to their properties and other characteristics
First, John Newlands looked at the atomic masses of the known elements. He noticed that elements with similar physical and chemical properties came in intervals of 8. (So the 1st, 8th and 15th element were similar.) He proposed this idea as a unifying principle of chemistry. But it didn't work very well - not all the elements matched up.
Mendeleev's contribution was to suggest that not all elements had been discovered yet. This was reasonable, because in those days a lot of new elements were being discovered. He rearranged the table so that it had gaps where he believed missing elements were. In fact, he was even confident enough to predict the properties of the missing elements. The risk paid off: Many of his predictions were uncannily accurate.
Since then there have been a few modifications. The missing elements have been discovered, as well as a whole new group not in Mendeleev's table (the noble gases). The lanthanides and actinides have been moved into their own part to save space. And it is now understood that the important number is not mass number but atomic number (in Mendeleev's time this distinction was not appreciated, since neutrons had not been discovered). But, on the whole, the table is the same today as it was when Mendeleev produced it.
We also have an understanding of why it is that this pattern exists. It is due to the number of electrons in the outer shell of electrons, as each group has a different number in its outer shell (for example, Sodium [Na] in group 1 has 1 electron in its outer shell while Oxygen [O] has 6 electrons in the outer shell). These also effect their reactivity and thus their characteristics (as mentioned before) due to the stability of different groups.