How can you improve the code to properly output the email address and username of users in a table?

The issue with the current code is that it is not properly outputting the email address and username of users in a table format. To solve this, we can use HTML table tags within the PHP code to structure the output in a tabular form. By iterating over the user data and adding each user's email address and username within table row tags, we can create a neat and organized table display.

echo "<table>";
echo "<tr><th>Email</th><th>Username</th></tr>";
foreach ($users as $user) {
    echo "<tr>";
    echo "<td>" . $user['email'] . "</td>";
    echo "<td>" . $user['username'] . "</td>";
    echo "</tr>";
}
echo "</table>";