- 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
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 UTC