CSS controlling text directly inside <td> |
CSS controlling text directly inside <td> |
Brian Chandler |
Dec 8 2011, 10:01 AM
Post
#1
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
I have text directly inside a <td>, as in the sample page here:
http://imaginatorium.org/private/cartons.html Can anyone tell me how to control the margin (padding etc) around this text? |
Christian J |
Dec 8 2011, 11:09 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
Is this for screen or print media (considering you use mm units)?
Table cells have no CSS margins, but the TABLE element can have http://www.w3.org/TR/CSS21/tables.html#pro...-border-spacing |
Brian Chandler |
Dec 8 2011, 11:22 AM
Post
#3
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
Thanks Christian. It's for printing, and I wanted to squeeze down the vertical margin/padding to get everything on one sheet.
The space between the top and bottom of the text and the adjacent cell border is more than the "padding" value on <td>. So I guess the text directly within the <td> gets some "default" padding/margin from somewhere, but there doesn't seem to be a way of accessing it. I have border-collapse: collapse; so I don't understand how "border-spacing" would apply? |
Darin McGrew |
Dec 8 2011, 11:33 AM
Post
#4
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
It could also be an effect of the line height, assuming it's greater than 1.0.
|
Frederiek |
Dec 8 2011, 12:19 PM
Post
#5
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
It seems that 1 mm equals 3 pixels and 2 mm equals 7 pixels for the padding you set on TD, according to the calculated style in Safari.
Otherwise, the page fits on a A4 paper, slightly a little too much to the right (only tested in Preview). |
Lo-Fi Version | Time is now: 19th April 2024 - 09:56 AM |