Closed Bug 186377 Opened 23 years ago Closed 23 years ago

css formatted (font-size) table row is not rendered as high as specified

Categories

(Core :: Layout, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: a9403825, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.3b) Gecko/20021220 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.3b) Gecko/20021220 <html> <head> </head> <body> <table border="0" cellpadding="0" cellspacing="0" bgcolor="Blue"> <tr> <td style="font-size: 5px;">&nbsp;</td> </tr> </table> </body> </html> the rendered table row has a height of 6px in this example Reproducible: Always Steps to Reproduce: 1. try code above 2. 3. Actual Results: rendered the table row 6px heigh Expected Results: rendered the table row as specified 5px heigh now plugins or themes installed, no localization
IIRC, the "font-size" does not include space for a descender (the bit below the baseline to allow for the dangling bits on lettes like j, g and y), nor does it allow for the extra bit of space needed to actually separate the lines. If you want to set the overall height of a line of text, use line-height, not font-size. However, in this case, you're trying to size a table cell, so you'd do even better to just use the height attribute on the table cell itself, rather than trying to fudge things by putting text in there to size it indirectly: <td style="height: 5px;">&nbsp;</td> As such, I think this bug should be resolved INVALID.
I agree with Gavin
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
Re comment 2, 'font-size' does in fat include space for the descenders, assuming they are within the character box. 'font-size' in CSS defeines the height of the character boxes, and one aassumes a font designer would typically put the baseline inside the character box. However, the problem here is that the 'line-height' is indeed driving up the size of the line box, and thus making the cell taller than anticipated. The following worked for me: <table border="0" cellpadding="0" cellspacing="0" bgcolor="Blue"> <tr> <td style="font-size: 5px; line-height: 5px;">&nbsp;</td> </tr> </table> Of course, your solution of simply setting the height of the cell directly is also one to consider, and I do agree this bug is INVALID. But I wanted to clear up the bit about what 'font-size' means.
> I wanted to clear up the bit about what 'font-size' means. Thanks, I needed it, even if no-one else did :)
You need to log in before you can comment on or make changes to this bug.