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

CSS - I have right padding on table cell but text still butts with text in next cell

Posted on 2013-06-09
5
424 Views
Last Modified: 2013-06-11
At the page below you can see the cell text in the 5th column butts up with the text in the 6th column even though I have TD right padding set to 5px;

http://www.housecarers.com/test4/photo_view2.cfm?mem=2145575946&slide=1

Please help
.ThumbTable   { table-layout: fixed;
			 	width: 800px;
}
.ThumbTable td th { padding:5px,5px,0,0;
                 text-align:left;
				 vertical-align: text-top;
				 vertical-align:top;
				 width:80px;
				 overflow: hidden;
				 }

Open in new window

0
Comment
Question by:Ian White
5 Comments
 
LVL 29

Expert Comment

by:Randy Downs
ID: 39233736
It doesn't look that way in Chrome.  Which browser are you using?
0
 
LVL 1

Accepted Solution

by:
vuhanguyen earned 300 total points
ID: 39233775
Your problem is:

.ThumbTable td th { padding:5px,5px,0,0;
                                 text-align:left;
                         vertical-align: text-top;
                         vertical-align:top;
                         width:80px;
                         overflow: hidden;
                         }

1. Your text is in a "td" not "td th"
2. There is no comma between values of padding command

It should look like this:
.ThumbTable td th { padding:5px 5px 0 0;
                                 text-align:left;
				 vertical-align: text-top;
				 vertical-align:top;
				 width:80px;
				 overflow: hidden;
				 }

Open in new window

0
 
LVL 22

Assisted Solution

by:Kim Walker
Kim Walker earned 200 total points
ID: 39234921
vuhanguyen has it almost right. He forgot to correct the "td th" issue that he mentions. If you want the css to be valid for both td and th, it should be:
.ThumbTable td, .ThumbTable th { padding:5px 5px 0 0;
                                 text-align:left;
				 vertical-align: text-top;
				 vertical-align:top;
				 width:80px;
				 overflow: hidden;
				 }

Open in new window

".ThumbTable td th" would only apply to a <th> tag that is a descendant of a <td> tag which is a descendant of an element with a class name of "ThumbTable." This would only work if you have nested tables and then only to the <th> tags in the nested table.
0
 
LVL 1

Expert Comment

by:vuhanguyen
ID: 39239896
Thanks xmediaman, i forgot it :D
0
 

Author Closing Comment

by:Ian White
ID: 39240037
Thanks, that works
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
innerHTML 7 35
jQuery Dialog Autoresize Bug 2 25
output of netstat -r in Powersshell HTML 3 26
HTML <font style="color:red"> 9 32
Find out what you should include to make the best professional email signature for your organization.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

828 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