What are some common pitfalls when trying to center text in PHP output without using tables?

One common pitfall when trying to center text in PHP output without using tables is not utilizing CSS properly. To center text using CSS, you can set the text-align property to center in a style attribute within the HTML output. Another pitfall is not properly enclosing the text within a container element with a specified width. By using CSS to style the container element with a set width and margin set to auto, you can effectively center the text.

<?php
echo '<div style="width: 50%; margin: 0 auto; text-align: center;">';
echo 'Centered text without using tables';
echo '</div>';
?>