Open Bug 308403 Opened 19 years ago Updated 2 years ago

Constraining table cells with max-height/max-width does not work

Categories

(Core :: Layout: Tables, defect)

defect

Tracking

()

People

(Reporter: MatsPalmgren_bugz, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: css2, testcase, Whiteboard: [reflow-refactor])

Attachments

(2 files)

(spawned off from bug 307866) Constraining table cells with max-height/max-width does not work
Attached file Testcase: max-height (deleted) —
Attached file Testcase: max-width (deleted) —
According to the CSS2 spec (http://www.w3.org/TR/REC-CSS2/visudet.html), "max-height", "min-height", "max-width", and "min-width" apply to "all elements except non-replaced inline elements and table elements." Now comes the fun part: what is a "table element"? The CSS2 table spec (http://www.w3.org/TR/REC-CSS2/tables.html), section 17.2.1, paragraph 1 mentions the phrase "table element" in reference to *any* element styled with a "display" of any of the table values (table, table-row, table-cell, etc.). I don't know that my reading is correct, but if it is, HTML's default stylesheet sets TD elements to be "display:table-cell", so they would theoretically count as "table elements," and, thus, would not have a "max-height" property. By default, tables get their height from their TRs, which in turn get their height from the TDs, which then get their height from the content (IOW, all "height:auto"). I think you can *simulate* what you want by setting the TD in question to have "height:100%", then create a DIV within the TD with "height:100%; max-height:[whatever]; overflow:auto;" for your content. The content is constrained by the DIV, and the DIV sets the height of the TD.
You're reading an old spec, CSS 2.1 is what we want to implement, it says: http://www.w3.org/TR/CSS21/visudet.html#min-max-widths "'min-width' and 'max-width' .... Applies to: all elements but non-replaced inline elements, table rows, and row groups" http://www.w3.org/TR/CSS21/visudet.html#min-max-heights "'min-height' and 'max-height' ... Applies to: all elements but non-replaced inline elements, table columns, and column groups" which is the same as for 'width'/'height' respectively BTW. (CSS3 box model also includes rows/cols/groups, but I would not rely to much on that working draft at this point). http://www.w3.org/TR/2002/WD-css3-box-20021024/#the-min-width http://www.w3.org/TR/2002/WD-css3-box-20021024/#the-width
Whiteboard: [reflow-refactor]
the css 3 box currently does not differ from CSS 2.1 http://www.w3.org/TR/css3-box/#min-max
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: