These elements are in the same group in the periodic table due to their electron configurations:
fluorine: 2, 7
chlorine: 2, 8, 7
They both have 7 electrons in their outer shell, so therefore are both in group 7 of the periodic table, with chlorine directly below fluorine.