What are the best practices for aligning content in tables using PHP, considering modern web development standards?

When aligning content in tables using PHP, it is best to use CSS for styling instead of inline styles. This follows modern web development standards and allows for better separation of concerns. You can use CSS classes to style the table and its content, ensuring a clean and maintainable codebase.

<?php
echo "<table class='table'>";
echo "<tr>";
echo "<th class='text-center'>Header 1</th>";
echo "<th class='text-left'>Header 2</th>";
echo "<th class='text-right'>Header 3</th>";
echo "</tr>";
echo "<tr>";
echo "<td class='text-center'>Data 1</td>";
echo "<td class='text-left'>Data 2</td>";
echo "<td class='text-right'>Data 3</td>";
echo "</tr>";
echo "</table>";
?>