Here is the layout of my table:
Grade Sign StudentGrade
6 + 1
6 0
6 - 0
5 + 0
5 0
5 - 0
4 + 0
4 0
4 - 1
3 + 0
3 1
3 - 0
2 + 1
2 0
2 - 0
1 + 0
1 1
1 - 0
This is how my HTML table looks:
<tr *ngFor="let item of gradeList;">
<td colspan="3" class="labelStyle" style="text-align:center">{{item.grade}}</td>
<td colspan="3" class="labelStyle" style="text-align:center" *ngIf="item.sign == 0"></td>
<td colspan="3" class="labelStyle" style="text-align:center" *ngIf="item.sign == 1">+</td>
<td colspan="3" class="labelStyle" style="text-align:center" *ngIf="item.sign < 0">-</td>
<td colspan="2" class="labelStyle" style="text-align:center">{{item.studentGrade}}</td>
</tr>
I am looking to dynamically assign colors to my table rows based on the grade. For example, I want the first 3 rows with grade 6 to be light grey, the next 3 rows with grade 5 to have the default color, and so on. How can I achieve this dynamically?