The different states at room temperature occur as a result of differences in the bonding and structure of chlorine and sodium chloride. In chlorine, there are covalent bonds between individual atoms which lead to the formation of simple molecules, between which there are weak forces of attraction. These are easy to separate and, therefore, chlorine has a low boiling point meaning that it is a gas at room temperature. On the other hand, within sodium chloride the atoms bond ionically, which means that there are strong bonds in all directions between oppositely charged ions. This leads to the formation of a giant lattice structure, which requires large amounts of energy to break. As a result, sodium chloride has a high melting point and is a solid at room temperature.