I’m trying to change the background color of a table’s rows using CSS, but I do not want to change a table heading’s background. However, by default, a TH is wrapped in a TR, so the TR rule is pushed to my TH.
Here’s a jsfiddle to test with, if it helps:
http://jsfiddle.net/jomanlk/Bcayc/
You can add
<thead>and<tbody>to differenciate your header rows from the data rows. This way you can target only the desired ones:DEMO
Along with the following markup: