I am in the process of creating a flexible table outputter that can handle any number of rows or columns. This is achieved by using nested ng-repeat attributes, as shown below:
<table>
<tr ng-repeat="row in rowList">
<td ng-repeat="col in colList">{{printCell(row,col)}}</td>
</tr>
</table>
Everything is working smoothly until I attempt to utilize ng-class-even
and ng-class-odd
to change the background color of the rows alternately.
If I apply the ng-class-***
statements to the td
tag, the alternating colors are applied to the columns instead of the rows.
When I move the ng-class-***
statements to the tr
tag, no classes are assigned at all, leaving the rows with the default styling.
My goal is to have alternating row colors. How can I achieve this?