Codice PHP:
$conta=0;
$coppiahtml=$html='';
foreach (
$array as $chiave=>$valore)
            { 
              
$coppiahtml.="<td>$chiave</td><td>$valore</td>";
              if(
$conta>&& $conta 2==0
                          {
                            
$html.="<tr>$coppiahtml</tr>";    
                            
$coppiahtml='';
                          }
                    
$conta++;
            }
if(
$coppiahtml)     $html.="<tr>$coppiahtml<td colspan='2'></td></tr>"