I have the following code, that creates a dynamic table with dynamic thead and tbody, the data is from a MySQL pivot table but displayed in a through php
while($row = $res->fetch_row())
{
echo "<tr>";
foreach($row as $cell) {
// dd($row);
if ($cell === NULL) { $cell = '-'; }
echo "<td>$cell</td>";
}
echo "</tr>\n";
}
I want to be able to return specific values for example the current result being returned is:
| Subject | Mark | Comment |
|---|---|---|
| English Language | 43 | Good work |
| English Literature | 59 | Good |
but I want to be able to via php make the mark color red when the student has recieved 50%, how can I doo that in the $cell variable?