title: How to create a dynamic table and show the results?
body: <p>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:</p>
  
  <pre><code>&lt;?php
  $connection = Mage::getSingleton('core/resource')-&gt;getConnection('core_read');
  $sql = $connection-&gt;query("SELECT column1, column2, column3 FROM table ");
  while ($row = $sql-&gt;fetch()) {
      $var1[] = $row['column1'];
      $var2[] = $row['column2'];
      $var3[] = $row['column3'];
  }
  ?&gt;
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>*-----------------------------------------------------------*
  | var1 record1 | var1 record2 | var1 record3 | var1 record4 |
  | var2 record1 | var2 record2 | var2 record3 | var2 record4 |
  | var3 record1 | var3 record2 | var3 record3 | var3 record4 |
  *-----------------------------------------------------------*
  </code></pre>
  
  <p>How can I create something like a dynamic table to show my records in an organized way in the screen?</p>
  
  <p>Edit 1:<br>
  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.</p>