In the CSS
of my HTML
table
I would like to insert conditional formatting code for the td-elements
. If the value of such an element's content is lower than 500, I want that value to be displayed in red. If not, it should be in black.
So if in my table there is e.g. the code <td>439</td>
, that number should be displayed in red. If it's <td>578</td>
, it should be in black.
This is the CSS
code I think would work (using the SCSS
extension):
td {
@if xxxxx < 500 {
color: red
} else {
color: black
}
}
What should I put instead of xxxxxx
? Or perhaps you know of an alternative coding solution.