I have set 3 specific colors in my CSS. I have an HTML table and I am looking to have the background color of a cell change based on 3 conditions:
if the cell contains the text 'True' - color green
if the cell contains the text 'False' - color red
if the cell contains the text 'None' - color yellow
Here is my CSS:
.color-green {
background-color: green;
color: black;
}
.color-yellow {
background-color: orange;
color: black;
}
.color-red {
background-color: red;
color: black;
}
And here is my HTML:
<td ng-class = "{'color-yellow':dict.status='True','color-red':dict.status=='false'}">{{ dict.status}}</td>
I initially attempted with 2 colors, but it only changed cells with the text 'True' to a red background. I have not worked with HTML in a while, but I recall this method working with numbers. I tried to search online but did not find a solution. Is there a way to achieve this with the 3 colors I have specified?