The electronic configuration of elements and their position in the periodic table are related to each other. From the electronic configuration of elements, we can determine the period and group to which the elements belongs.
Consider sodium with atomic number 11. K,L and M shells have 2,8 and 1 electron each. Since there are 3 principal energy levels, sodium belongs to third period.
M shell (valence shell) has only 1 electron. So sodium belongs to group 1 or IA.
Now consider chlorine with atomic number 17. K,L and M shells have 2,8 and 7 electron each. Since there are 3 principal energy levels, chlorine belongs to third period.
M shell (valence shell) has7 electrons. So chlorine belongs to group 7 or VIIA.