* Sodium (Na) has one valence electron in its outer shell. It wants to lose this electron to achieve a stable octet configuration like the noble gas neon.
* Chlorine (Cl) has seven valence electrons. It wants to gain one electron to achieve a stable octet configuration like the noble gas argon.
When sodium loses its electron, it becomes a positively charged ion (Na+). When chlorine gains an electron, it becomes a negatively charged ion (Cl-). These oppositely charged ions attract each other electrostatically, forming an ionic bond.
The resulting compound is sodium chloride (NaCl), which is table salt.