Solved

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

Posted on 2006-11-30
3
188 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now