I'm currently working on developing a transaction table that is intended to display debit values in red and credit values in green. However, I would like these colors to only be applied if the value in the table data is greater than 0 via JavaScript. Can someone please assist me with this?
<table class="table table-bordered table-striped">
<thead>
<tr bgcolor="#ccccff">
<th scope="col"> Debit</th>
<th scope="col"> Credit</th>
</tr>
</thead>
<tbody>
<tr>
<td id='red' style="color:red; font-weight: bold;"> 100 </td>
<td id='green' style="color:green; font-weight: bold;">
200
</td>
</tr>
</tbody>