W3C home > Mailing lists > Public > www-style@w3.org > March 2004

Re: Styling table columns--why so limited?

From: Alan Plum <alan@cologneweb.com>
Date: Mon, 29 Mar 2004 19:57:38 -0500 (EST)
Message-ID: <4068AF13.7030603@cologneweb.com>
To: www-style@w3.org

Dan Delaney wrote:
> Could someone please point me to a discussion of the rationale behind 
> such limited style options for the colgroup and col elements? I'd like 
> to know why the spec doesn't allow for something as important as 
> "text-align" and other styles on those elements.
> Thanks
> --Dan

I've been wondering about that for a while as well, but looking at the 
DOM tree it actually makes sense.
The col element itself has semantical meaning, but doesn't actually 
contain any td's or th's. These are contained within a tr.
You can style a tr and the child elements (td/th) will inherit that 
styling. They cannot inherit properties of non-parent elements tho.

A good solution is using th's and the good old "headers" attribute in 
conjunction. Sure, you have to define the headers for every cell, but 
that also makes it more accessible.
In CSS you can use the [attr="value"] selector to style all tds in a 
particular col or row or otheriwse related to a header.

Sadly that won't work in MSIE. There's no way but using classes in IE.

Please also note this is a CSS discussion list, not a support list for 
implementation issues in combination with particular markup languages. 
You're not exactly asking in the right place.

Received on Wednesday, 31 March 2004 09:11:59 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:12 UTC