When elements are arranged in the periodic table, they are organized according to their atomic number, which is the number of protons in the nucleus. As we move across a period from left to right, we add protons and electrons to the atoms, filling up the electron shells.
Each electron shell can hold a specific number of electrons. The first shell can hold up to 2 electrons, the second shell can hold up to 8 electrons, the third shell can hold up to 18 electrons, and so on. As we add electrons to the atoms, we fill these electron shells in order, starting with the first shell.
When the first shell is full, we move on to the second shell, and so on. This explains why the periodic table has periods, which are horizontal rows of elements that have the same number of electron shells.
The number of periods in the periodic table corresponds to the number of electron shells that can be filled. There are seven electron shells, so there are seven periods in the periodic table.