Codice PHP:
<?php
$arr
=array(1,2,3,4,5,6,7);
    
$i=0;
$num=3;//puoi metterci quello che vuoi 
// break array over rows
print '<table border=1>';
while(
$i <= count($arr)) {
    
// row of five items
    
print '<tr>';
        for(
$r=1;$r<=$num;$r++) {
        print 
'<td>'$arr[$i] .'</td>'."\n";
        
$i++;
        }
    print 
'</tr>';
}
print 
'</table>';
?>