Solved

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

Posted on 2013-06-09
5
431 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 69
JQuery conflicts/syntax issue 4 25
how to customize the text in the legend in highcharts 3 35
Check input text, Number 7 35
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

726 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