Solved

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

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to dynamically set the form action using jQuery.

760 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

20 Experts available now in Live!

Get 1:1 Help Now