Log in

View Full Version : Specify TD height = 5px



mtran
08-02-2007, 04:17 AM
I have an html table of data. I want to have some blank rows to separate different kinds of data. Those blank rows I want to spcify their height = 5px, but it doesn't seem to work. The row height is always about 12px;

It sounds like an easy and stupid question, but how can I do it to make it really work really?

jscheuer1
08-02-2007, 06:02 AM
Avoid tables whenever possible.

The layout height of a cell is its height plus 2 times its padding or cellpadding and 2 times its margin or cellspacing. Into this mix you can in some cases add borders. Also taken into account can be the font height as determined by the font-size. Different browsers look at many of these things differently.

To be more specific, we would need to have a link to your page.

Tabo
08-02-2007, 09:15 AM
To get around the above post what i do is give it a class of .something then in a css page specify the .something font size as something very small amoung giving it other properties, then i remove the &nbsp; from those cells so its just <td></td> It works in a few browsers but not all, i siggest spacing cells with borders.

Twey
08-02-2007, 04:53 PM
Avoid tables whenever possible.There's nothing wrong with using tables for real tabular data; in fact, it's what they're designed for, and much preferable to abusing other elements to this purpose.

Tabo, beware: a lot of browsers will not show a table cell with no content.