How to give two different bgcolor for alternative rows in a table dynamically using CSS.
I don't want to use jQuery for solving this problem.
Use :nth-child() pseudo class
tr:nth-child(odd){
background-color:green
}
tr:nth-child(even){
background-color:yellow
}
DEMO
Here is few more selector example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With