An ionic compound is a chemical compound held together in a lattice structure by ionic bonds.
Ionic bonds are bonds between oppositely charged ions.
For example, lets use the most commonly known ionic compound, Table salt, or Sodium Chloride (
This is the same concept that we use to explain magnets. The positive(+) side is attracted to the negative(-) side, and vice versa.
The opposite charges attract each other. (Opposites Attract)