I have an HTML table with two columns (description and value), and I need each row to paint a specific color depending on the value of the "value" column.
With jQuery I am using this:
$("#mitabla td:last-child:contains(5)")
.parents("tr")
.css("background-color", "verde");
but if I do the same for each value (the possible values are known, only numbers between 1-10) it does not work, and only colors according to the first condition that I have written.
How can this be done, with some if
or switch
?