JSFiddle - React, Tailwind, and code Playground
HTML
<table border="1" id="myTable">
<thead>
<tr>
<th>Col 1</th>
<th>Col 2</th>
</tr>
</thead>
<tboby>
<tr>
<td>LOW</td>
<td>HIGH</td>
</tr>
<tr>
<td>OTHER</td>
<td>MEDIUM</td>
</tr>
<tr>
<td>LOW</td>
<td></td>
</tr>
<tr>
<td>HIGH</td>
<td>HIGH</td>
</tr>
</tboby>
</table>
CSS
.low{
color:blue;
}
.medium{
color:yellow;
}
.high{
color:red;
}
JavaScript
$(document).ready(function(){
$("#myTable tbody tr td").each(function(){
var text = $(this).text();
if(text == "LOW" || text == "MEDIUM" || text == "HIGH")
$(this).addClass(text.toLowerCase());
});
});