# data[].attributes.body
Sulfur belongs to column 16 in the periodic table
-> So, its atom has 6 valence electrons.

Carbon belongs to column 14 in the periodic table.
-> Its atom has 4 valence electrons.

Sulfur & Carbon are both non-metals.
So, a covalent bond will be formed.
Sulfur must share 2 electrons to attain stability with an octet. However, Carbon must share 4 electrons to attain stability with an octet.
So, two sulfur atoms will share its electrons to the carbon atom so both can be stable and form a covalent bond.

# data[].attributes.body
Sulfur is in column 16 of the periodic table.
-> Its atom has 6 valence electrons. }

Magnesium belongs to column 2 of the periodic table
-> Its atom has 2 valence electrons.

However, S is a non-metal and Mg is a metal.
-> So, an ionic bond will be formed.
Sulfur must gain 2 electrons to attain stability with an octet.
Magnesium must lose 2 electrons to attain stability with an octet.
So, a transfer of electrons will occurr from magnesium to sulfur.