What are some alternative approaches to displaying data in columns using PHP and HTML?

When displaying data in columns using PHP and HTML, one alternative approach is to use CSS to create a multi-column layout. This can be achieved by setting the display property of the container element to "grid" or "flex" and specifying the number of columns. This allows for a more flexible and responsive layout compared to traditional table-based columns.

echo '<div style="display: grid; grid-template-columns: repeat(3, 1fr);">';
foreach ($data as $item) {
    echo '<div>' . $item . '</div>';
}
echo '</div>';