<?php
//$liste = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
//$liste = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22);
$liste = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
$row = ceil(count($liste)/10);
?>
<table>
<tr>
<?php if ($row > 1) { ?>
<td width="100" rowspan="<?php echo $row; ?>">
<?php } else { ?>
<td width="100">
<?php } ?>
BUTTON 1</td>
<td width="50"><?php echo @$liste[0]; ?></td>
<td width="50"><?php echo @$liste[1]; ?></td>
<td width="50"><?php echo @$liste[2]; ?></td>
<td width="50"><?php echo @$liste[3]; ?></td>
<td width="50"><?php echo @$liste[4]; ?></td>
<td width="50"><?php echo @$liste[5]; ?></td>
<td width="50"><?php echo @$liste[6]; ?></td>
<td width="50"><?php echo @$liste[7]; ?></td>
<td width="50"><?php echo @$liste[8]; ?></td>
<td width="50"><?php echo @$liste[9]; ?></td>
<?php if ($row > 1) { ?>
<td width="100" rowspan="<?php echo $row; ?>">
<?php } else { ?>
<td width="100">
<?php } ?>
BUTTON 2</td>
</tr>
<?php for ($a = 1; $a < $row; $a++) { ?>
<tr>
<td width="50"><?php echo @$liste[(10*$a)]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+1]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+2]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+3]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+4]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+5]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+6]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+7]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+8]; ?></td>
<td width="50"><?php echo @$liste[(10*$a)+9]; ?></td>
</tr>
<?php } ?>
</table>