funguje mi to i obecněji takto
<?php
$t = '<table border=1>';
$i = 0;
$k = 5;
$vysl = array('a','b','c','d','e','f','g','h','i','j','k','l','m');
while (list($field) = each($vysl)) {
$j = $i % $k; // binarni nasobeni $k (3)
if ($j==0) {$t .= '<tr>';}
$t.='<td>'.$field.'</td>';
if ($j==$k) {$t .= '</tr>';}
$i++; }
$r = abs($j-$k+1);
for ($w=1; $w<=$r; $w++) {$t.='<td> </td>';}
$t .= '</tr>';
$t .= '</table>';
echo $t;
?>
|