Change colour of table td based on value


I have this code in my table calling in a number

    <td>Total: <?php echo $total_credit;?></td>

I would like to change the background colour or the text colour depending on whether this value is equal to or higher than 2, is there an easy way I could do this with an If statement?

Thanks for any help in advance!

, Lucy Brown 4 years 2020-03-29T12:51:28-05:00 0 Answers 103 views 0

Leave an answer