Columns as ancestors

I would like to propose the following change to descendant selectors:
<BLOCKQUOTE
cite="http://www.w3.org/TR/REC-CSS2/selector.html#descendant-selectors">
At times, authors may want selectors to match an element that is the
descendant of another element in the document tree (e.g., "Match those
EM elements that are contained by an H1 element"). Descendant selectors
express such a relationship in a pattern. A descendant selector is made
up of two or more selectors separated by whitespace. A descendant
selector of the form "A B" matches when an element B is an arbitrary
descendant of some ancestor element A.
</BLOCKQUOTE>
should be:

<BLOCKQUOTE>
At times, authors may want selectors to match an element that is the
descendant of another element in the document tree (e.g., "Match those
EM elements that are contained by an H1 element"). Descendant selectors
express such a relationship in a pattern. A descendant selector is made
up of two or more selectors separated by whitespace. A descendant
selector of the form "A B" matches when an element B is an arbitrary
descendant of some ancestor element A. For the purposes of descendant
selectors, table cells are treated as descendants of table columns. For
all other purposes however, table cells are not descendants of table
columns.
</BLOCKQUOTE>
(Or similar in the new WD.)

This is intended to address the fact that it is otherwise
extraordinarily difficult to apply column-wide styles, a problem in the
main caused by the fact that only four styles apply to columns -
backgrounds, width, visibility and borders.

For example, at present if I wanted to align the following table
correctly:

<TABLE>
<COL id="product">
<COL id="cost">
<TR>
<TH>
Product
<TH>
Cost price
<TR>
<TD>
WundaCad 6.2
<TD>
$999.99
<TR>
<TD>
SupaCad 7
<TD>
$69.99
</TABLE>
at present I would have to markup each cost cell separately with a class
or style attribute, which is highly inefficient - COL#cost {text-align:
"."} has no effect, TABLE {text-align: "."} ruins the left column and
COL#cost TD {text-align: "."} doesn't match any cells.

Incidentally, why not have table column pseudo-elements?

Received on Friday, 4 February 2000 09:17:56 UTC