tags:

views:

119

answers:

2

I am testing the <colgroup> tag on a 5 columns table, with a style attribute.

I can't seem to make it work on firefox 3.6/chrome 5 tho, and this is when I started searching for the reference on w3c.
It seemed like my code was perfectly fine, but looking at the w3c editor I noticed not even that was working. Only IE8 seems to work correctly, opera 10.51 ignores the style tag but applies the align tag correctly, while ffox and chrome seems to ignore colgroup completely.

So what am I (and w3c) doing wrong? Was colgroup deprecated and I missed it?

+1  A: 

The CSS 2.1 Standard only allows a very small selection of properties to apply to cells in columns, because the cells are not real descendants of columns.

Some browsers such als Firefox adhere to these standards, while others allow more properties to take effect.

See: http://www.w3.org/TR/CSS2/tables.html#columns

If you want to apply other properties such as text-align you should give all cells in the column the same class and apply the style to that class.

RoToRa
+1  A: 

Table cells are not descendants of the columns they are in (hierarchical data structures don't represent 2 dimensional data very well).

Hixie explains in detail: http://ln.hixie.ch/?count=1&amp;start=1070385285

David Dorward
That makes colgroups nearly useless, but I see why it is necessary, thank you
Razor