Color rows after even / odd row selectors in css

rojghspb

New Member
given a table\[code\]<table><tr class="sechead">...<tr>...<tr>... <tr class="sechead">...<tr>...<tr>...</table>\[/code\]I have tried the following. I want it to alternate the colours for the rows coming after sechead.\[code\]table tr.sechead:nth-child(even) ~ tr{background-color:rgb(75,172,198);}table tr.sechead:nth-child(odd) ~ tr{background-color:rgb(153,129,189);}\[/code\]It color all the rows with the same color. Any possible solutions for this?
 
Back
Top