Solved

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

Posted on 2006-11-30
3
191 Views
Last Modified: 2010-04-06
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
0
Comment
Question by:davidawhite
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Steggs earned 500 total points
ID: 18048216
Instead of using padding on the cell. Try using margin on the text instead

<span style="margin:10px;">yadayadayadayada</span>

Regards
0
 

Author Comment

by:davidawhite
ID: 18048258
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)
0
 

Author Comment

by:davidawhite
ID: 18049211
well it works thanks for the help
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question