Set a td class based on a data value

Set a td class based on a data value

filipblaauwfilipblaauw Posts: 1Questions: 1Answers: 0

Hi, I have a dataset which looks like this:
"Name":"John Doe",
"Location":"Atlanta",
"Priority":"High"

The priority field have values low, medium, high.

In the table, I want the first cell to have a corresponding background color, e.g. a green background for "low", a yellow for "medium" and red for "high". Can I get this datavalue to be a class in the first table column, like "class":"medium"

Then I would just style the .medium style in css, with a background color.

Is this possible?

Answers

This discussion has been closed.