On 10 Nov 2005, at 11:13 am, James Bennett wrote:
>
> I once read through a long and protracted Mozilla bug report on this
> which I'm currently unable to locate; IIRC the problem, conceptually,
> is that individual table cells are not actually children of the
> COLGROUP or COL; as a result, they don't inherit properties from
> COLGROUPs and COLs in an intuitive way. And Philippe is right that IE
> is buggy -- CSS2 is very explicit on the matter of which properties
> may be set on a COLGROUP or COL and be applied to their cells:
> 'border', 'background', 'width' and 'visibility'.

James already answered the question more or less; a good explanation is 
the text by Ian Hickson [1].
The bug James refers to might have been bug 915 [2].
There was a discussion on the subject on the www-style mailing list 
[3], it is not the only (recent) one, browse the archives there.
In short it is all a question of the DOM, the cascade and inheritance. 
View your table with Gecko's DomInspector, and you'll see that the 
tr/td are not children/descendant of the col/colgroup.

You can do <col class="myclass">, and use that for IE, and then for 
good browsers, use adjacent sibling selectors for better browsers.

.myclass {text-align: center}
td:first-child+td+td {text-align: center} /* the 3rd column */

***But***, and here IE is buggy again, you *cannot* group those 
selector, else IE doesn't recognise the .myclass selector.

[1] <http://ln.hixie.ch/?start=1070385285&count=1>
[2] <https://bugzilla.mozilla.org/show_bug.cgi?id=915>
[3] <http://lists.w3.org/Archives/Public/www-style/2005Jul/0110.html>

Browsers are fun anyway, and HTML tables are messy objects.
Philippe
---
Philippe Wittenbergh
<http://emps.l-c-n.com/>

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to