Re: [CSS21][17.5.2.1 Fixed table layout] Questions on fixed table layout algorithm

On Mon, 21 Nov 2011 01:22:31 +0100, Gérard Talbot <www-style@gtalbot.org>  
wrote:

> Hello,
>
> [nightly-unstable]
> http://test.csswg.org/suites/css2.1/nightly-unstable/html4/table-layout-applies-to-006.htm
>
> [RC6]
> http://test.csswg.org/suites/css2.1/20110323/html4/table-layout-applies-to-006.htm
>
> "
> 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.
> (...)
> "
> section 17.5.2.1 Fixed table layout
> http://www.w3.org/TR/CSS21/tables.html#fixed-table-layout
>
> The algorithm given in section 17.5.2.1
> http://www.w3.org/TR/CSS21/tables.html#fixed-table-layout
> requires as input the set non-auto width of the table (and table borders
> in border-collapse: collapse mode or cell spacing in border-collapse:
> separate; we'll just assume we have such info) and then one of the
> following 2 data:
> - one set non-auto width of a column or
> - one set non-auto width of a cell in first row
>
> Now, in the table-layout-applies-to-006 testcase, we do not have one of
> those 2 data. Because of that, I think the testcase is incorrect. Am I
> wrong here?

I believe so, yes. The next sentence in the section you quoted:

"Any remaining columns equally divide the remaining horizontal table space  
(minus borders or cell spacing)."

The parenthetical seems like sloppy wording, but luckily there are no  
borders or cell spacings here so each column gets 10em/2.

> 2- What is the meaning of an empty colgroup for CSS formatting purposes?
> Colgroup can have 0 or more columns. I think an empty colgroup is totally
> meaningless and worthless for use in the fixed table layout like in the
> following code:
>
> colgroup {width: 100px;}
> ...
> <colgroup></colgroup>

Yes, I don't see the point of the .colgroup <div>s. The only relevant spec  
quote I see is

"A column group box occupies the same grid cells as the columns it  
contains."

> 3- Even if I have
>
> colgroup {width: 400px;}
> (...)
> <colgroup>
>   <col>
>   <col>
> </colgroup>
>
> in a simple 2 column (2 cells per row) table with 'table-layout: fixed',
> no one can establish how wide are respectively supposed to be first  
> column
> and second column. Am I wrong?

It seems reasonably clear from the spec that the colgroup width should be  
ignored, and your test results indicate that the majority of the browsers  
tested conform to this.

> 3 testpages on all this:
>
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/table-layout-applies-to-006a.html
>
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/table-layout-applies-to-006b.html
>
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/table-layout-applies-to-006c.html

-- 
Øyvind Stenhaug
Core Norway, Opera Software ASA

Received on Monday, 21 November 2011 12:44:18 UTC