How can the PHP code be modified to ensure that the last entry in the table is highlighted in bold without disrupting the column structure?
To ensure that the last entry in the table is highlighted in bold without disrupting the column structure, we can modify the PHP code to add a CSS class to the last row of the table. By targeting the last row with a specific class in the CSS, we can apply the bold styling without affecting the column structure of the table.
<?php
// Your PHP code to fetch data and create the table
$data = array("Entry 1", "Entry 2", "Entry 3", "Entry 4", "Entry 5");
echo "<table>";
foreach ($data as $key => $entry) {
echo "<tr";
if ($key == count($data) - 1) {
echo " class='last-row'";
}
echo "><td>$entry</td></tr>";
}
echo "</table>";
?>
```
CSS:
```css
<style>
.last-row {
font-weight: bold;
}
</style>