Create table from array
<p>I have the following array.    </p>

<pre><code>array(2) {
      ["BA"]=&gt;
      array(20) {
        [48]=&gt;
        int(311)
        [22]=&gt;
        int(291)
        [78]=&gt;
        int(291)
        [85]=&gt;
        int(289)
        [40]=&gt;
        int(288)
        [4]=&gt;
        int(288)
        [81]=&gt;
        int(287)
        [34]=&gt;
        int(285)
        [75]=&gt;
        int(285)
        [60]=&gt;
        int(283)
        [20]=&gt;
        int(283)
        [14]=&gt;
        int(283)
        [87]=&gt;
        int(283)
        [59]=&gt;
        int(282)
        [51]=&gt;
        int(282)
        [66]=&gt;
        int(281)
        [15]=&gt;
        int(281)
        [30]=&gt;
        int(276)
        [84]=&gt;
        int(276)
        [44]=&gt;
        int(275)
      }
      ["CA"]=&gt;
      array(20) {
        [80]=&gt;
        int(306)
        [77]=&gt;
        int(293)
        [84]=&gt;
        int(293)
        [88]=&gt;
        int(292)
        [78]=&gt;
        int(290)
        [87]=&gt;
        int(290)
        [83]=&gt;
        int(287)
        [90]=&gt;
        int(285)
        [72]=&gt;
        int(285)
        [15]=&gt;
        int(284)
        [1]=&gt;
        int(282)
        [85]=&gt;
        int(282)
        [81]=&gt;
        int(280)
        [86]=&gt;
        int(280)
        [56]=&gt;
        int(279)
        [32]=&gt;
        int(278)
        [69]=&gt;
        int(278)
        [79]=&gt;
        int(278)
        [53]=&gt;
        int(277)
        [89]=&gt;
        int(277)
      }
    }
</code></pre>

<p>I want to create a html table from this array like the following:</p>

<pre><code>_________________
48|311||80|306||
_________________
22|291||77|293||
_________________
78|291||84|293||
_________________
</code></pre>

<p>Here's the table layout:</p>

<pre><code>&lt;tr&gt;
&lt;td&gt;first array index of first group&lt;/td&gt;
&lt;td&gt;first array value of first group&lt;/td&gt;
&lt;td&gt;first array index of second group&lt;/td&gt;
&lt;td&gt;first array value of second group&lt;/td&gt;
&lt;/tr&gt; 
&lt;tr&gt;
&lt;td&gt;second array index of first group&lt;/td&gt;
&lt;td&gt;second array value of first group&lt;/td&gt;
&lt;td&gt;second array index of second group&lt;/td&gt;
&lt;td&gt;second array value of second group&lt;/td&gt;
&lt;/tr&gt;
and so on...
</code></pre>

<p>Can someone help me with the for loop I have to use to build this?</p>

<p>Your help is much appreciated.</p>
