On Nov 8, 2011, at 9:41 AM, Angela French wrote:

> Normally, I would use colgroup to center the text in table cells, but this is 
> a complex table with two rows of <th> and it is confusing me.  Perhaps it's 
> not even possible (or maybe I'm just tired and not seeing the obvious?) .  In 
> the table linked to below, I would like to center  the third, fourth, and 
> fifth columns of data.  Can anyone suggest how I might do that please?
> 
> http://www.sbctc.ctc.edu/college/_f-tuitionwaivers_runningstartNEW.aspx

td:first-child + td + td,
td:first-child + td + td + td,
td:first-child + td + td + td + td {text-align: center;} [1]

(dito for TH if that is what you want)

You can't use the <colgroup> or <col> element for doing that; only a very 
limited subset of CSS properties apply to those elements.
<http://www.w3.org/TR/CSS21/tables.html#columns>

Yeah, I know HTML4 allows for the 'align' attribute on <col>, but except for IE 
in quirks mode, it doesn't work anywhere. HTML5 has dropped those attributes.

[1] or with the :nth-child pseudo-class, but you get wider browser coverage 
with the above:
td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {}



Philippe
--
Philippe Wittenbergh
http://l-c-n.com/






______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to