The positively charged protons in the nucleus attract the negatively charged electrons. As the number of protons in the nucleus increases...the electronegativity or attraction will increase. Therefore electronegativity increases from left to right in a row in the periodic table.

This effect only holds true for a row in the periodic table because the attraction between charges falls off rapidly with distance.  The distance of the electrons from the nucleus remains relatively constant in a periodic table row but not in a periodic table column.  The force between two charges is given by Coulomb’s law.

In this expression, Q represents a charge, k represents a constant and r is the distance between the charges.  When r = 2, then r2 = 4.  When r = 3, then r2 = 9. When r = 4, then r2 = 16.  It is readily seen from these numbers that, as the distance between the charges increases, the force decreases very rapidly. This is called an exponential change.

The result of this change is that electronegativity increases from bottom to top in a column in the periodic table even though there are more protons in the elements at the bottom of the column. Elements at the top of a column have greater electronegativities than elements at the bottom of a given column. 

The overall trend for electronegativity in the periodic table is diagonal from the lower left corner to the upper right corner. 

Since the electronegativity of some of the important elements cannot be determined by these trends (they lie in the wrong diagonal), we have to memorize the following order of electronegativity for some of these common elements.

F > O > Cl > N > Br > I > S > C > H > metals