How can CSS be used to style tables created in PHP?
To style tables created in PHP using CSS, you can add inline styles directly to the HTML output of the PHP code or link an external CSS file to the PHP file. This allows you to apply various styles such as changing the font, colors, borders, padding, and alignment of the table elements.
<?php
// PHP code to create a table
echo "<table style='border: 1px solid black;'>";
echo "<tr><th>Name</th><th>Age</th></tr>";
echo "<tr><td>John</td><td>25</td></tr>";
echo "<tr><td>Jane</td><td>30</td></tr>";
echo "</table>";
?>