Re: [CSS2.1] col attributes: XHTML and CSS inconsistency?

On Tue, Dec 30, 2008 at 10:31 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> If :nth-col can apply the full range of styling (not just the standard
> 4 attributes), then why can't we just move this functionality into
> <col>?  Does the fact that it's a pseudoclass rather than a normal
> element allow you to defer the styling decisions somehow?  If it is at
> all possible I'd like to avoid introducing a new entity when there are
> existing ones begging to be enhanced.

That means that the HTML col element is magical on the CSS syntax
level.  "foo" in a selector means "match any element named foo", not
"match any element named foo unless 'foo' is 'col', in which case
apply special HTML-specific logic".

However, I don't see why :nth-col() is the most logical substitute for
HTML col functionality.  It seems like a feature more like the desired
functionality for col would be :col(), accepting a selector and
matching any cell that's semantically part of a col element that
matches the selector.  So for instance, in this table:

<table>
<col id="col1"> <col id="col2">
<tr><th id="cell1">Foo <th id="cell2">Bar
<tr><td id="cell3" colspan="2">Baz
<tr><td id="cell4">Quuz <td id="cell5">Quuuz
</table>

":col(#col1)" would be equivalent to "#cell1, #cell3, #cell4", and
":col(#col2)" would be equivalent to "#cell2, #cell3, #cell5".  This
is how attributes like align work in HTML4, AFAIK, which is what
people seem to want.

I assume that would be more difficult to do than :nth-col(), but not
insurmountable the way markup applied directly to col is.  The
advantage is, of course, that it would allow things like applying
rules to columns specified by classes without having to worry about
what position they're in in the particular table.

Received on Tuesday, 30 December 2008 15:54:17 UTC