Scripsit howa:
Quote:
Hello, I want to style the first column (i.e. all TD in the first col)
using CSS? |
Does that column actually consist of row headers? Then TH markup would be
more logical - and would make the styling easier.
Quote:
I have tried, e.g.
td:first-child { color: red; }
but not working, any suggestions? |
Which browser(s) did you test it on? IE 6 and older don't support
:first-child, and even IE 7 doesn't in Quirks Mode. But in any modern
browser, for a document that complies with HTML specifications, it works. Of
course this might not be enough, since IE 6 is still the most popular
browser.
Then what's left is the clumsy way of using <td class="first"> in all the
cells of the column and using a class selector. With any decent web page
editor, modifying the markup is easy, so the clumsiness is only at the
markup level.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/