estradowiec
estradowiec

Reputation: 241

CSS - Select row table without first column

I want select row in css without first column. I tried like this, but not working:

#testTable tbody tr:not(td:first-child):hover{ /*Code*/ }

Does anyone know the answer to this problem?

Upvotes: 2

Views: 2605

Answers (1)

Fabrizio Calderan
Fabrizio Calderan

Reputation: 123367

#testTable tbody tr:hover td:not(:first-child) { 
  /* ... */
}

or — if you need to support older browser, like IE8 and IE7 — you may write

#testTable tbody tr:hover td + td {
  /* ... */
}

this will select all columns inside tbody except the first one of each row (when you hover the row)

Example: http://codepen.io/anon/pen/aItBr/

Upvotes: 6

Related Questions