jquery – Conditional table cell background color depending on value

I have a HTML table that I’m trying to change the cell background color to red depending on the value of the cell. Each cell will have a different threshold for when red is needed (one cell might be > 5, another > 10). The cells are sporadic throughout the table, and none are related to the other. Further, jquery is used to pull the value in from a value stored in a SharePoint list. Is there some way to check the value when it’s pulled from the list and change the color before it’s inserted in the table? Not sure what the best approach is for this. Thanks in advance for any help offered!

Table row code:

  <td colspan="3" style="width:30%; background-color:#015A78; color:White; text-align:center; 
  font-size:20pt; font-weight:bold; border-width:thick; border-style:inset"><div 
  id="subjectivehoverMouseover" title="">Subjective</div></td>

  <td style="background-color:Black; color:White; text-align:center; font-weight:bold; border- 
  style:inset"><div id="SubjectiveDays"></div></td>


And the jquery to pull in the value for SubjectiveDays in the last cell above:

 if (listItem.Title === "subjectivegrading") {
           $("#SubjectiveDays").text(listItem.c3t9 + " Business Days");

This is just one cell/id in the table. The ‘c3t9’ value will change. Depending on the user input on a different SP page, the value in the list will change. Then that value from the list is being pulled into a single cell in a table.