Link to home
Start Free TrialLog in
Avatar of davidawhite
davidawhite

asked on

Adding padding is pushing columns wider for no apparent reason 500 pts - I'm stumped

I have stripped the page down to nothing and I'm still having the problem. I have a basic table 2 rows three columns. here is some example code:

<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td width="230" align="left" valign="top"><img src="images/logo.jpg" width="230" height="254"></td>
          <td width="270" align="left" valign="top">cell 2</td>
      <td width="260" align="left" valign="top">cell 3</td>
        </tr>
      <tr>
          <td width="230" align="left" valign="top">cell 1 2nd row</td>
          <td width="270" align="left" valign="top">cell 2 2nd row</td>
      <td width="260" align="left" valign="top">cell 3 2nd row</td>
       </tr>
</table>

Now if I add style="padding: 10px;" to the <td> tag for "cell 1 2nd row" what I would expect is that I would get 10px of padding around the words in that cell.

If I had a REALLY long word or an image that was wider than 210px in that cell it would push my columns out wider than I want them.

What happens is if I add the padding like I said above it pushes the cell out wider (even if there's nothing in the cell) which also pushes out the cell above it which has the image in it, and I get unwanted padding. By the way it does it in every browser I can try it on.

Please Help - Dave
ASKER CERTIFIED SOLUTION
Avatar of Mark Steggles
Mark Steggles
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davidawhite
davidawhite

ASKER

I'll give it a try, but shouldn't the way I was doing it have worked or am I not allowed to add the style to the td tag? (I know shouldn't be using tables, I working that direction)
well it works thanks for the help