Closed Bug 666493 Opened 13 years ago Closed 13 years ago

in a table with 'table-layout:fixed', CSS property 'width' on <colgroup> doesn't do anything

Categories

(Core :: Layout: Tables, defect)

9 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: changho.cha, Unassigned)

Details

Attachments

(1 file)

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.
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?
Attached image table layout
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
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?
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.
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → 9 Branch
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
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Component: Layout → Layout: Tables
QA Contact: layout → layout.tables
Resolution: --- → INVALID
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 .)
Summary: When I use table tag with a style 'table-layoux:fixed', property 'width' for <colgroup> doesn't work. → in a table with 'table-layout:fixed', CSS property 'width' on <colgroup> doesn't do anything
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: