How can PHP be integrated with HTML and CSS to create visually appealing and functional tables?

To integrate PHP with HTML and CSS to create visually appealing and functional tables, you can use PHP to generate dynamic content for the table rows and columns. You can also use PHP to fetch data from a database and populate the table with the retrieved data. Additionally, you can use PHP to apply conditional formatting to the table cells based on certain criteria.

<?php
// Sample PHP code to create a table with dynamic content
$data = array(
    array("John Doe", "25", "john.doe@example.com"),
    array("Jane Smith", "30", "jane.smith@example.com"),
    array("Mike Johnson", "28", "mike.johnson@example.com")
);

echo "<table>";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Age</th>";
echo "<th>Email</th>";
echo "</tr>";

foreach($data as $row){
    echo "<tr>";
    foreach($row as $cell){
        echo "<td>".$cell."</td>";
    }
    echo "</tr>";
}

echo "</table>";
?>