Last Comment Bug 666493 - in a table with 'table-layout:fixed', CSS property 'width' on <colgroup> doesn't do anything
: in a table with 'table-layout:fixed', CSS property 'width' on <colgroup> does...
Status: RESOLVED INVALID
:
Product: Core
Classification: Components
Component: Layout: Tables (show other bugs)
: 9 Branch
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-22 20:56 PDT by zzazang
Modified: 2011-08-28 17:15 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
table layout (82.94 KB, image/png)
2011-06-23 18:58 PDT, zzazang
no flags Details

Description zzazang 2011-06-22 20:56:52 PDT
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0

<table width="100%" border="1" style="table-layout:fixed">
  <colgroup span="2" width="20%" align="left"></colgroup>
  <colgroup align="right" style="color:#0000FF;"></colgroup>
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>

As above, If I use style 'table-layout:fixed' for <table> tag, the property 'width' in colgroup doesn't work. It works on all the other browsers like Safari, Opera, IE, Chrome. 

https://bugzilla.mozilla.org/show_bug.cgi?id=458924
https://bugzilla.mozilla.org/show_bug.cgi?id=327645
I googled and there were some issues like this. But, I've heard that it was fixed.

http://code.google.com/p/chromium/issues/detail?id=20865
I found that there were same issue with this problem, but it might be fixed.

http://stackoverflow.com/questions/5704187/firefox-4-and-table-layout-fixed
I can find same problem in Stakoverflow

http://www.w3.org/TR/html4/struct/tables.html
http://www.w3.org/TR/1998/REC-CSS2-19980512/tables.html#width-layout
I've watched those standard documentation, there is no solutions for this problem.

Reproducible: Always

Steps to Reproduce:
1. Make a table with colgroup
2. set style 'table-layout:fixed' to the table
3. add colgroup tag into the table, and set 'width' property to the 'table' tag.

Actual Results:  
Table columns has Same width, even though I set width for each column.
Comment 1 (mostly gone) XtC4UaLL [:xtc4uall] 2011-06-23 15:01:04 PDT
Hmm, the above Testcase looks the same for me from Firefox 2 over 5 up to recent Nightly Trunk Builds - and different compared to MSIE 8, Opera 11.50 and GC 14 what all render the same.

You're sure about this not rather being an ancient Table Rendering Bug?
Comment 2 zzazang 2011-06-23 18:58:26 PDT
Created attachment 541573 [details]
table layout
Comment 3 zzazang 2011-06-23 19:01:42 PDT
I attached a screenshot. 
The version of browsers in this screenshot are like this:
Opera 11.11
Chrome 13.0.782
Firefox 5
Internet Explorer 7
Comment 4 zzazang 2011-06-23 19:05:30 PDT
Is firefox3 renders this table same as firefox 5?
Hmm.How do you think? Is this not a bug? Or It this just a different policy of firefox? I think this is a bug of current firefox.

(In reply to comment #1)
> Hmm, the above Testcase looks the same for me from Firefox 2 over 5 up to
> recent Nightly Trunk Builds - and different compared to MSIE 8, Opera 11.50
> and GC 14 what all render the same.
> 
> You're sure about this not rather being an ancient Table Rendering Bug?
Comment 5 zzazang 2011-06-23 19:24:19 PDT
I made some tests again, I noticed that the width property of '<col>' elements in <colgroup> tag works properly. The problem is just related to 'width' property in <colgroup> tag. 

According to the standard document, it is not really clear. Is <colgroup> tag is 'column element' or not? 
BTW, all of the other browsers in market are supporting 'width' property in <colgroup> even if the table has property 'table-layout:fixed'. So, I think it can be better that firefox supports as same.
Comment 6 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2011-08-28 17:12:02 PDT
http://www.w3.org/TR/CSS21/tables.html#fixed-table-layout says:

======
In the fixed table layout algorithm, the width of each column is determined as follows:

    A column element with a value other than 'auto' for the 'width' property sets the width for that column.
    Otherwise, a cell in the first row with a value other than 'auto' for the 'width' property determines the width for that column. If the cell spans more than one column, the width is divided over the columns.
    Any remaining columns equally divide the remaining horizontal table space (minus borders or cell spacing). 
======

It doesn't say anything about column groups, therefore widths on them must be ignored.  It only mentions columns.

-> invalid
Comment 7 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2011-08-28 17:14:16 PDT
That said, I think it would be reasonable to change the spec here to allow column groups to affect such tables.  The right place to send such a proposal is the mailing list:
http://lists.w3.org/Archives/Public/www-style/ and the subject of any such message should begin with "[CSS21] ".  If you send a proposal for how it should work to the mailing list, feel free to reopen this bug.

(The code to fix lives in layout/tables/FixedTableLayoutStrategy.cpp .)

Note You need to log in before you can comment on or make changes to this bug.