HTML CSS examples for CSS Widget:Table Row
Use nth-child(odd) on table rows
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> table tr.trclass:nth-child(odd) { color:Chartreuse; } table tr.trclass:nth-child(9n + 9) { color:yellow; } </style> <!--from ww w. j av a 2 s . c o m--> </head> <body> <table> <tbody> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass exempt"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass exempt"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass exempt"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> <tr class="trclass"> <td>L</td> </tr> </tbody> </table> </body> </html>