I am displaying mySQL in an html table.
I would like to change the TD background color of $qty to red IF $qty >= $max or $qty =< $min
.
Is there a simple a way to do this with jQuery or PHP?
I simplified my table and PHP for my example:
<table id="tablesorter-demo">
<tr><td>'.$min.'</td><td>'.$max.'</td><td>'.$qty.'</td></tr>
</table>
var min = $('table tr td:eq(0)').text();
var max = $('table tr td:eq(1)').text();
var qty = $('table tr td:eq(2)').text();
if (qty >= max || qty <= min ) {
$('table tr td:eq(2)').css('background-color', 'red');
}