Answers for "how would you style table rows to have alternating background colors? tr:even{background-color:#ccc;} td:even{background-color:#ccc;} td:nth-child(even){background-color:#ccc;} tr:nth-child(even){background-color:#ccc;}"

CSS
14

css table alternating row color

tr:nth-child(even) {background: #CCC}
tr:nth-child(odd) {background: #FFF}
Posted by: Guest on February-26-2020

Code answers related to "how would you style table rows to have alternating background colors? tr:even{background-color:#ccc;} td:even{background-color:#ccc;} td:nth-child(even){background-color:#ccc;} tr:nth-child(even){background-color:#ccc;}"

Browse Popular Code Answers by Language