I don't know if this could be declared as an "easy" approach, but I came up with the following.
You have to forgive the math formula (I was always bad w/ math)!
PHP Code:
<?php $items = Array(); $items[1] = 'A'; $items[2] = 'B'; $items[3] = 'C'; $items[4] = 'D'; $items[5] = 'E'; $items[6] = 'F'; $items[7] = 'G'; $items[8] = 'H'; $items[9] = 'I'; $items[10] = 'J'; $items[11] = 'K'; $items[12] = 'L'; $items[13] = 'M'; $items[14] = 'N'; $items[15] = 'O'; $rows = 3; $cols = 5; echo '<table cellpadding="8" border="1">'; for($r = 0; $r < $rows; $r++) { echo '<tr>'; for($i = 1; $i <= count($items) / $rows; $i++) { echo '<td>' . $items[( ($i * $rows) + ($r - $rows + 1) )] . '</td>'; } echo '</tr>'; } echo '</table>'; ?>
__________________
<mgraphic /> - I don't have a solution but I admire the problem.
|