I am trying to implement a style where every other row in my table (myrow) has a different background color. However, currently it is only showing the color specified for odd rows.
.myrow, .myrow:nth-of-type(odd) + .myrow:nth-of-type(even) ~ .myrow:nth-of-type(odd) {
background: #f8f8f8;;
}
.myrow:nth-child(even),.myrow:nth-child(even) ~ .myrow:nth-of-type(odd),
.myrow:nth-child(even) + .myrow:nth-child(odd) ~ .myrow:nth-of-type(even){
background: blue;
}
<table class="col-xs-12 col-sm-12 col-md-12 col-lg-12 main-table ">
<ng-container *ngFor="let r of results">
<tr class="myrow">
<div class="row>
<div class="col-xs-12 col-sm-12 col-md-11 col-lg-11">
<table class="wd-100 bus-table">
<tr></tr>
</table>
</div>
</div
</tr>
</ng-container>
</table>