Create table from array
I have the following array.    

    array(2) {
          ["BA"]=>
          array(20) {
            [48]=>
            int(311)
            [22]=>
            int(291)
            [78]=>
            int(291)
            [85]=>
            int(289)
            [40]=>
            int(288)
            [4]=>
            int(288)
            [81]=>
            int(287)
            [34]=>
            int(285)
            [75]=>
            int(285)
            [60]=>
            int(283)
            [20]=>
            int(283)
            [14]=>
            int(283)
            [87]=>
            int(283)
            [59]=>
            int(282)
            [51]=>
            int(282)
            [66]=>
            int(281)
            [15]=>
            int(281)
            [30]=>
            int(276)
            [84]=>
            int(276)
            [44]=>
            int(275)
          }
          ["CA"]=>
          array(20) {
            [80]=>
            int(306)
            [77]=>
            int(293)
            [84]=>
            int(293)
            [88]=>
            int(292)
            [78]=>
            int(290)
            [87]=>
            int(290)
            [83]=>
            int(287)
            [90]=>
            int(285)
            [72]=>
            int(285)
            [15]=>
            int(284)
            [1]=>
            int(282)
            [85]=>
            int(282)
            [81]=>
            int(280)
            [86]=>
            int(280)
            [56]=>
            int(279)
            [32]=>
            int(278)
            [69]=>
            int(278)
            [79]=>
            int(278)
            [53]=>
            int(277)
            [89]=>
            int(277)
          }
        }
I want to create a html table from this array like the following:

    _________________
    48|311||80|306||
    _________________
    22|291||77|293||
    _________________
    78|291||84|293||
    _________________

Here's the table layout:

    <tr>
    <td>first array index of first group</td>
    <td>first array value of first group</td>
    <td>first array index of second group</td>
    <td>first array value of second group</td>
    </tr> 
    <tr>
    <td>second array index of first group</td>
    <td>second array value of first group</td>
    <td>second array index of second group</td>
    <td>second array value of second group</td>
    </tr>
    and so on...

Can someone help me with the for loop I have to use to build this?
 
Your help is much appreciated.

Create table from array
===

I have the following array.    

    array(2) {
          ["BA"]=>
          array(20) {
            [48]=>
            int(311)
            [22]=>
            int(291)
            [78]=>
            int(291)
            [85]=>
            int(289)
            [40]=>
            int(288)
            [4]=>
            int(288)
            [81]=>
            int(287)
            [34]=>
            int(285)
            [75]=>
            int(285)
            [60]=>
            int(283)
            [20]=>
            int(283)
            [14]=>
            int(283)
            [87]=>
            int(283)
            [59]=>
            int(282)
            [51]=>
            int(282)
            [66]=>
            int(281)
            [15]=>
            int(281)
            [30]=>
            int(276)
            [84]=>
            int(276)
            [44]=>
            int(275)
          }
          ["CA"]=>
          array(20) {
            [80]=>
            int(306)
            [77]=>
            int(293)
            [84]=>
            int(293)
            [88]=>
            int(292)
            [78]=>
            int(290)
            [87]=>
            int(290)
            [83]=>
            int(287)
            [90]=>
            int(285)
            [72]=>
            int(285)
            [15]=>
            int(284)
            [1]=>
            int(282)
            [85]=>
            int(282)
            [81]=>
            int(280)
            [86]=>
            int(280)
            [56]=>
            int(279)
            [32]=>
            int(278)
            [69]=>
            int(278)
            [79]=>
            int(278)
            [53]=>
            int(277)
            [89]=>
            int(277)
          }
        }
I want to create a html table from this array like the following:

    _________________
    48|311||80|306||
    _________________
    22|291||77|293||
    _________________
    78|291||84|293||
    _________________

Here's the table layout:

    <tr>
    <td>first array index of first group</td>
    <td>first array value of first group</td>
    <td>first array index of second group</td>
    <td>first array value of second group</td>
    </tr> 
    <tr>
    <td>second array index of first group</td>
    <td>second array value of first group</td>
    <td>second array index of second group</td>
    <td>second array value of second group</td>
    </tr>
    and so on...

Can someone help me with the for loop I have to use to build this?
 
Your help is much appreciated.
