i have this code
<table class="table table-bordered text-center font-weight-bold">
<tr>
<?php
for ($i = 1; $i <= 60; $i++) { ?>
<td class="<?= $i == 7 || $i == 8 || $i == 11 ? 'bg-danger' : 'bg-success'; ?> m-0 p-0">
<a href="#" style="text-decoration: none; font-size: 5vw">
<div class="h-100 w-100 my-2 text-white">
<?= $i; ?>
</div>
</a>
</td>
<?php if (!empty($i) && ($i) % 6 == 0) {
?>
</tr>
<tr>
<?php } ?>
<?php }
?>
</tr>
</table>
showing this result i don't want to
i want result like this
1 2 3 4 5 6
12 11 10 9 8 7
13 14 15 16 17 18
24 23 22 21 20 19
25 26 27 28 29 30
36 35 34 33 32 31
37 38 39 40 41 42
etc...
i have no idea how the most simple logic works for this