I have a table that is dynamically generated by PHP. I am hoping that I can use CSS to apply a background color based on where the table row is odd/even, i.e. the backgroun
You can use the nth-of-type() or nth-child() selector in CSS3. Supported by all modern Browsers.
For example...
tr:nth-child(odd) { background-color: #ccc; } /* Do this… */ tr:nth-of-type(odd) { background-color: #ccc; } /* …or this */ tr:nth-of-type(even) { background-color: #ccc; }