Sent by Philippe Wittenbergh on 9 March 2007 00:12
On Mar 9, 2007, at 7:30 AM, Rolf Mortenson wrote:
> What is the optimal way to align data in a very large table? - let's
> say you've got a few thousand rows, and 10 columns, and you want data
> in 3 of those columns to be aligned right (the rest align left). Is
> it preferable to give each td in those columns a class -- <td
> class="right">? or is it better to use the old <td align="right">?
> Neither seems like the ideal... but I don't get the impression that
> col and colgroup have much effectiveness here either. Is there an IE-
> compatible way to target the 5th cell in a row? Is this a case for a
> javascript solution over css?
td:first-child+td+td+td {text-align:right;} will select the 4th
column in good browsers (including IE7).
For IE 6, you need to use the col element.
<table>
<colgroup><col><col><col><col class="alignRight"><col><col></colgroup>
col.alignRight {text-align:right;}
Note that you have to put the 2 selectors on separate lines, _not_
grouping them, else IE 6 won't recognise anything.
Philippe
---
Philippe Wittenbergh
<http://emps.l-c-n.com>
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/