I have a set of data in a MySQL database. I have a table created from these data using PHP loops. I want to style certain rows in certain ways. For example, the data fetched from the database are in groups of 2, 3, 4, 5 rows. There are a about 25 rows of data and I'd like to style each group a bit differently, e.g., add color to row sub heading...
I built this out and didn't quite take into consideration that this styling was necessary. The client wants this styling and now I'm trying to figure out how to make it.
Here is an image from Excel with the kind of thing I'm trying to accomplish:

I could just hand write the HTML and then style it but the code is much cleaner and tighter when using the PHP loops. Also, if I can figure this out, I could use this as a model and template for other scenarios where I need to style certain parts of a table from more data.
Here is the PHP snippet:
<table>
<tr>
<th>hd1</th>
<th>hd2</th>
<th>hd3</th>
</tr>
<?php
$mysqli = <connect to db is fine>;
$query = 'SELECT a, b, c from t1';
if($stmt = mysqli_prepare($mysqli, $query)) {
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $a, $b, $c);
while (mysqli_stmt_fetch($stmt)) {
echo '<tr>';
echo '<td>' . $a . '</td>';
echo '<td>' . $b . '</td>';
echo '<td>' . $c . '</td>';
echo '</tr>';
}
}
?>
</table>
whileloop. nothing fancy... I'll add snippets.