10.10.2011 23:21, Angela French wrote:

Is there a way to style a single column in a table with
> text-align:center  without having to apply the class/style to every
> <td>  in the column?

Yes, but you might find it easier to use a class attribute in each <td>.

On modern browsers, you can use complex selectors like

td:first-child + td + td + td

which matches the fourth cell of each row _assuming_ that all cells are <td> (not <th>) elements.

Older versions of IE (which you might decide to ignore in this context but which might not be completely ignorable yet) can be handled e.g. by using <col> elements in HTML markup:

<col><col><col><col align=center>

--
Yucca, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
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