The main group elements span both sides of the periodic table and form a sandwich on either side of the transition metals. The main difference between main group elements and transition elements is that the charges or partial charges on the main group elements are much easier to predict in any molecule. Many of the transition elements form species with varying charges. Often the only way to figure out the charge within the compound is to base it on the negatively charged atom, typically a main group element.
Generally, metals exist on the left side of the table and nonmetals on the right. The metals tend to lose electrons to form a + charge on an atom while the nonmetals tend to gain an electron to form a - charge on an atom.
In an ionic compound, the + and - charged atoms come together in an attractive bond. Thus typically this bond is made from one atom on the left side of the PT while the other atom is from the right of the PT.
The covalently bonded compounds, on the other hand, typically come from two nonmetals on the right hand side of the table. Since nonmetals tend to form - charged atoms, the attraction between two - charged atoms is obviously not a +/- charge. It is nothing like this because the outer electrons of both atoms rearrange themselves to form a more stable arrangement of shared electrons between the two atoms.
The top periodic table shows certain elements in yellow. These are elements that tend to form gases like H2, O2, F2, Cl2 and others. We call these diatomic gases (as the label indicates). These have very pure covalent bonds between atoms because the properties of each atom are exactly the same.