css - Can the contents of a table cell overflow vertically? -
a table cell may have content overflows, explained in in fixed table layout:
any cell has content overflows uses 'overflow' property determine whether clip overflow content.
but can overflow vertical? table height algorithms says
in css 2.1, height of cell box minimum height required content.
so if understand correctly, shouldn't possible. can make happen on firefox:
table { height: 0; border: 5px solid blue; } td { width: 100px; height: 100%; border: 5px solid red; } div { height: 100%; border: 1px solid; background-color: yellow; } <table> <tr> <td> <div>foo</div> <div>bar</div> </td> </tr> </table> 
am misunderstanding spec, or bug?
§17.5.3 table height algorithms says
css 2.1 not define how height of table cells , table rows calculated when height specified using percentage values.
and shows — wildly different results in various browsers.
here's looks on ie:

and on chrome:

from can tell:
chrome calculating minimum height required having both
divelements @ minimum height required contents, sizing table accordingly, , ignoringheight: 100%declaration ondivelements.ie , firefox size table in same way chrome, choose apply
height: 100%ondivelements instead. results in overflow describe.ie funky expands first
divupwards, seemingly ignoring baselines altogether despite factdivelements block-level, not inline-level.
since undefined behavior, particularly kind deals percentage heights, it's hard if of browsers either correct or wrong in specific situation. suspect you're more likely, though still not guaranteed, satisfactory answer original question specifying fixed heights on table cells instead.
Comments
Post a Comment