Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XSL Grouping 7 42
Node js - send response after all promises are resolved 1 58
Problem to echo 6 109
Stupid git question 2 101
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…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

792 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