Select all 'tr' except the first one

Steven Spielberg picture Steven Spielberg · Oct 25, 2010 · Viewed 171k times · Source

How can I select all tr elements except the first tr in a table with CSS?

I tried using this method, but found that it did not work.

Answer

Magnar picture Magnar · Oct 25, 2010

By adding a class to either the first tr or the subsequent trs. There is no crossbrowser way of selecting the rows you want with CSS alone.

However, if you don't care about Internet Explorer 6, 7 or 8:

tr:not(:first-child) {
    color: red;
}