W3C home > Mailing lists > Public > www-style@w3.org > June 2005

Re: [CSS21] properties for table-column (In HTML: COL) & table-column-group (In HTML: COLGROUP) items.

From: <Kris@meridian-ds.com>
Date: Wed, 22 Jun 2005 14:06:53 -0500
To: Ryan Cannon <ryan@ryancannon.com>
Cc: www-style@w3.org
Message-ID: <OFC473ECDA.8EB5396F-ON86257028.0068FFFC-86257028.0069001B@meridian-ds.com>


Well, Ryan, and I'm not trying to be a pain here, but wouldn't we likely
style a colspanned cell differently?  And there's already a selector that
even works in Moz for that.  I'm just asking.

Kris


Ryan Cannon's Message Below:

>
> Can't you just use an :nth-child for tds in a tr?
>
> tr:nth-child(1) {
>   background-color:#lime;
> }
>
> Just specificy what you want the colors to be inside of nth-child,
> and move
> on with life.  This should allow you to color any column you please.
> Course, the requires nth-child support but yeah... css will do it with
> ease.
>
> Kris
>

This doesn't work once you start spanning columns. Imagine the
following html table:

<table>
     <tr>
         <td>Cell 1:1</td><td>Cell 1:2</td><td>Cell 1:3</td>
     </tr>
     <tr>
         <td colspan="2">Cell 2:1</td><td>Cell 2:2</td>
     </tr>
</table>

Using tr:nth-child(3) to highlight the third column breaks here. It
also could not handle adding or subtracting columns dynamically. I've
argued for this before on the list, and have always been told it's an
implementation nightmare. But it /is/ necessary if we truly want to
use tables for data.
Received on Wednesday, 22 June 2005 19:07:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:37 GMT