如何创建动态表并显示结果?

I need to create a table using a variable number of records to insert on it. The number of records comes from a select in my database which returns the value of 3 columns and I store them in 3 vars. For example:

<?php
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$sql = $connection->query("SELECT column1, column2, column3 FROM table ");
while ($row = $sql->fetch()) {
    $var1[] = $row['column1'];
    $var2[] = $row['column2'];
    $var3[] = $row['column3'];
}
?>

Let's suppose that I have 4 rows in my table, so each of my vars are going to store 4 records and I need to create something like this in my screen:

*-----------------------------------------------------------*
| var1 record1 | var1 record2 | var1 record3 | var1 record4 |
| var2 record1 | var2 record2 | var2 record3 | var2 record4 |
| var3 record1 | var3 record2 | var3 record3 | var3 record4 |
*-----------------------------------------------------------*

How can I create something like a dynamic table to show my records in an organized way in the screen?

Edit 1:
Just to make it clearer, the table I want to display is in my php page. I don't know how many records the select will return, that's why it should be a dynamic table, but all my 3 vars will ALWAYS have the same amount of records, for example: If my table has 7 rows, then my 3 arrays are going to have 7 records each. The while loop is also working correctly.

Just did it with the following code:

<?php $count = count($var1); ?>

<div class='container' style="background-color: #dadfe0; text-align: center;">

    <?php for ($i = 0; $i < $count; $i++): ?>
        <div class='bigdiv<?php echo $i ?>' style="display: inline-block; margin: 20px">
            <div class='column1' style="margin-bottom: 15px">
                <?php echo $var1[$i]; ?>
            </div>
            <div class='column2' style="margin-bottom: 15px">
                <?php echo $var2[$i]; ?>
            </div>
            <div class='column3'>
                <?php echo $var3[$i]; ?>
            </div>
        </div>
    <?php endfor; ?>

</div>