min-width/min-height/max-width/max-height does not work for table elements

Assigned to
(NeedInfo from)



Layout: Tables
12 years ago
5 months ago


(Reporter: Giampaolo Bellavite, Assigned: mats, NeedInfo)


(Blocks: 1 bug, {css2, testcase})

css2, testcase

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [reflow-refactor] [webcompat], URL)


(6 attachments, 1 obsolete attachment)



12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

See the example here:
the <tbody> tag should display scrollbars in the table thanks to the following
style sheet:
<tbody style="max-height:110px;overflow:auto">
in Firefox 1.5 beta1 this seems not working, as happens in Firefox 1.0.6

Reproducible: Always

Steps to Reproduce:
Create a long table with max-height/overflow:auto style sheet properties in the
<tbody> tag. The max height value should be less height than the table height.
Actual Results:  
Scrollbars don't appears

Expected Results:  
Show scrollbars

I've upgraded from firefox 1.0.6 to firefox 1.5 beta

Comment 1

12 years ago
Created attachment 195521 [details]
Example file

Comment 2

12 years ago
I found the CSS2 specification doesn't allow the max-height property in table cells:
So I guess this is not really a bug.
Severity: normal → minor

Comment 3

12 years ago
In the latest CSS 2.1 working draft, max-height is said to apply to "all 
elements but non-replaced inline elements, table columns, and column groups", so 
it should affect TBODY. 
Component: General → Layout: Tables
Product: Firefox → Core
QA Contact: general → layout.tables
Version: unspecified → Trunk

Comment 4

12 years ago
INVALID per comments 2 and 3.
Last Resolved: 12 years ago
Resolution: --- → INVALID
You misread comment 3.
Resolution: INVALID → ---

Comment 6

12 years ago
Created attachment 195974 [details]
TABLE min-height

Comment 7

12 years ago
Created attachment 195975 [details]
TR min-height

Comment 8

12 years ago
Created attachment 195976 [details]
TD min-width/height

Comment 9

12 years ago
Created attachment 195977 [details]
TBODY min-height

Comment 10

12 years ago
Created attachment 195978 [details]
TBODY max-height
Attachment #195521 - Attachment is obsolete: true


12 years ago
Assignee: nobody → mats.palmgren
Severity: minor → normal
Ever confirmed: true
Keywords: css2, testcase
OS: Windows XP → All
Hardware: PC → All
Summary: CSS: max-height in tbody doesn't work in 1.5 beta1 → min-width/min-height/max-width/max-height does not work for table elements

Comment 11

12 years ago
Created attachment 195979 [details] [diff] [review]
Patch rev. 1
Attachment #195979 - Flags: superreview?(dbaron)
Attachment #195979 - Flags: review?(bernd_mozilla)


12 years ago
Blocks: 308403

Comment 12

12 years ago
Comment on attachment 195979 [details] [diff] [review]
Patch rev. 1

I have spawned off max-height/max-width for table cells to bug 308403,
which this patch does not address (other than setting up a correct
reflow state).

Comment 13

12 years ago
*** Bug 227650 has been marked as a duplicate of this bug. ***

Comment 14

12 years ago
Mats, sorry for the delay but its high on my priority list now.

+        if (eStyleUnit_Auto == heightUnit) {
+          mComputedHeight = (mComputedMinHeight == 0) ? NS_AUTOHEIGHT :
+        } else {

Could you please convince me that this is the right thing to do.

If a auto height table element has a min height it gets a computed height?

Wouldnt that break for standards mode the pct to auto conversion for children of
such a element?

nsStyleCoord nsTableColFrame::GetStyleWidth() const

I have big doubts that the changes are correct, while usually fixed widths are
the upper limits, with the patch a specified min width on a column turns the
column into a column with a fixed width, I would rather expect that a specified
min width influences rather the MEW than changes a col type.


Comment 15

12 years ago
Comment on attachment 195979 [details] [diff] [review]
Patch rev. 1

The changes to BasicTableLayoutStrategy are wrong. The min-width should update
the max-width is an additional constraint which should be added between MIN_PRO
and FINAL. The new constraint should take part in the balancing.
My proposal is to split these widths for colspans just by dividing trough the
real cols that it covers.
Attachment #195979 - Flags: review?(bernd_mozilla) → review-
Attachment #195979 - Flags: superreview?(dbaron)
Blocks: 311639

Comment 16

11 years ago
Out of curiousity... has this bug been forgotten?
No point working on this until reflow branch lands, since that rewrites pretty much all of BasicTableLayoutStrategy.
Whiteboard: [reflow-refactor]

Comment 18

11 years ago
2.0 is out, any news on when the reflow branch will land and when this will be fixed?
Kelly, what 2.0 is doing is completely unrelated to the reflow branch.  The current trunk plan is to stabilize the existing cairo and Cocoa widget work, then ship an alpha of Gecko 1.9 sometime in early to mid November, with any luck, then land the reflow branch on the trunk.  After that, this bug should be revisited.

You can keep track of the current state of reflow branch via http://wiki.mozilla.org/Gecko:Reflow_Refactoring#Status and http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyAll&branch=REFLOW_20060830_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot

Comment 20

11 years ago
Now that the reflow branch has landed, will this bug be revisited?
At some point, sure.  There are 80-some open bugs (including this one) that are flagged as needing someone to look at them after the branch lands, so...  ;)

Comment 22

11 years ago
Most of the patch is obsolete due to the reflow branch landing.


10 years ago
Duplicate of this bug: 394472

Comment 24

10 years ago
This is still alive.

Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.9b3pre) Gecko/2008010605 Minefield/3.0b3pre


9 years ago
Duplicate of this bug: 453034

Comment 26

8 years ago
It's weird, but this bug still seems to be present in FF3.5
I still do not see the expected behaviour on my divs containing tables like FF1.x did...
Please address this issue again. It's really annoying..

Comment 27

8 years ago
For me, I was setting up a table I wanted to center and set the max-width.  It worked--but only if I used inline styles.  If I use a class, "max-width:792px;" is treated as "width:792px;" and the table is left justified.  To be fair, IE appears to be doing the same.
This bug is about table _internal_ elements, not <table>s.  We don't do anything differently for inline style vs class styling, so it sounds like you just had a mistake in your class styling somewhere.  Please file a separate bug if you think there was a Gecko issue on your testcase, and attach your testcase to that bug.

Comment 29

8 years ago

Any news on this bug, this is still current en very much annoying. Any idea on when it will be fixed, it seems to take a long time...
Comment hidden (off-topic)
Comment hidden (off-topic)
Danilo, comments 30 and 31 have nothing to do with this bug.

Comment 33

4 years ago


Comment 34

4 years ago
I do not understand why it takes so long to fix "min-height" because the "height" property is interpreted as minimum height on tables anyway (it's like an alias).

Today, only Firefox does not support this property on table, even with IE 11 it works fine. It's surprising to see a basic layout property not working only on firefox and to do a workaround only for this browser.

I thought maybe nobody reported it, but since 2005 this bug is know. I don't know what is happening, maybe this bug should be splitted in 4 differents bugs (one for each properties).
No longer blocks: 311639
Duplicate of this bug: 977929
This page is broken in Firefox because of this: https://developer.chrome.com/devsummit/sessions/

Comment 37

3 years ago
I just ran into this problem also, pretty annoying to see my site broken in FF and have to spend extra time having to fix it for a specific browser.


2 years ago
Duplicate of this bug: 1206271

Comment 39

2 years ago
There's duplicates of this bug here (or this is a duplicate of one of them :D) : 
bug 720669
bug 975632
bug 308403
bug 434230
(found with https://bugzilla.mozilla.org/buglist.cgi?quicksearch=max-width+table)
That's not a great search, because....

> bug 720669

Is about an element _inside_ a table cell, not a table element.

> bug 975632

Same thing.

> bug 434230

Same thing.

> bug 308403

Is already marked dependent on this bug.
Duplicate of this bug: 1221721

Comment 42

2 years ago
This bug is more than 10 years old. When might we see a fix for it?
Probably a duplicate Web Compatibility issue.
I just ran into this again on http://flyweb.github.io/
I think one good thing to do is to figure out which of the 36 combinations of:
 - -height vs. -width (with table-layout: auto) vs. -width (with table-layout: fixed, in the first row of course)
 - min- vs. max-
 - on table vs. column vs column-group vs. row vs. row-group vs. cell
do *something* in other browsers, and whether what they do seems interoperable at a very basic level.

It may be worth filing separate bugs on many of these things rather than trying to do them all in one bug.


a year ago
Flags: needinfo?(bugs)

(In reply to David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) from comment #45)
> I think one good thing to do is to figure out which of the 36 combinations
> of:
> It may be worth filing separate bugs on many of these things rather than
> trying to do them all in one bug.

I created a reduced test case for one of the Web Compat bug when I was trying to understand what was happening. See

Surprised to see how old this issue is. @karlcow's codepen illustrates the issue perfectly.

FYI, my current hack to make this work is to add any specific height in addition to the min-height declaration.  Doesn't seem like that should be needed, but it works for now.


Comment 48

11 months ago
I have noted that this case now corrected in Firefox Developer Edition 50.0a2 (will come to regular Firefox soon I hope), but now it does not override the height if somewhere before min-height, height is declared in percents (%).

Here is the sample

Comment 49

11 months ago
I'm not seeing this as being corrected in Firefox Dev edition 50.0a2.  I've attached a screenshot of it displaying your code-pen.


Comment 50

10 months ago
Adding another case 


6 months ago
Whiteboard: [reflow-refactor] → [reflow-refactor] [webcompat]
You need to log in before you can comment on or make changes to this bug.