image showing times and comments not aligned
I am attempting to perfect the alignment of times and comments in separate tables.
<?php
while ($line = mysqli_fetch_array($result, MYSQLI_ASSOC)){
$time = date("H:i", strtotime($line["event_date"]));
$date = date_format($nice_date, "l, jS F");
colours = array("table-active", "table-success", "table-warning", "table-danger", "table-info");
$i = 0;
?>
//Code checks if new date is encountered. If so, a new table starts.
<h2><?php echo $date; ?></h2>
<div class="container">
<table class="table table-sm">
<tbody>
<tr class=<?php echo $colours[$i % 5]; ?>>
<th scope="row"></th>
<td><div class="text-sm-left" ><?php echo $time;?></div></td>
<td><div class="text-sm-left" ><?php echo $line["comment"];?></div></td>
</tr>
</tbody>
</table>
</div>
<?php
}
?>
The tables display times and comments that are properly aligned within each table, but not consistently between tables.
I have experimented with using the class "text-sm-left" sans its own div, but it did not yield the desired outcome. Additionally, I tried utilizing the class "text-left" with no success. An image has been uploaded to illustrate the issue with misaligned tables.