In my table I have a column named statusid. If the value of this column is 1, the complete row needs to color yellow. if the value is 2 then it needs to be red. 0 is just default white.
What is the best way to do this?
<div class="container-fluid">
<table id="table_id" class="cell-border order-column row-border hover compact" width="100%">
<thead>
<tr>
<th width="2%">ID</th>
<th width="6%">Debiteur</th>
<th width="10%">Klantnaam</th>
<th width="3%">Aantal Pallets</th>
<th width="3%">Totaal Gewicht</th>
<th width="30%">PB Nummers</th>
<th width="10%">Toevoegdatum</th>
<th width="1%">statusid</th>
</thead>
<tbody>
<!-- Fetch from db -->
<!-- Connect to db-->>
<?php
$conn = mysqli_connect("localhost","root","","export") or die("Error in Connection");
$query = mysqli_query($conn, "SELECT exportid, deb_nmr, cost_name, numb_pal, tot_weight, pb_s, date, statusid FROM export_tabel");
while ($result = mysqli_fetch_array($query)) {
echo "<tr>
<td>".$result['exportid']."</td>
<td>".$result['deb_nmr']."</td>
<td>".$result['cost_name']."</td>
<td>".$result['numb_pal']."</td>
<td>".$result['tot_weight']."</td>
<td>".$result['pb_s']."</td>
<td>".$result['date']."</td>
<td>".$result['statusid']."</td>
</tr>";
}
?>
</tbody>
</table>
</div>