<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}-->
Ionic compounds are the compounds that are formed by the gain or lose of electrons. In other words these are formed by the attraction of cations and anions are called as ionic compounds. Example:
2Na+Cl2→2Na++Cl−→2NaCl
Sodium is a group 1 metal, thus forms a +1 charged cation. Chlorine is a non-metal, and has the ability to form a -1 charged anion.