<?php $array = array(1,2,3,4,5,6); echo '<table><tr>'.chr(10); for($i=0;$i<count($array);$i++) { if($i % 2 == 0 and $i != 0) echo '<tr></tr>'.chr(10); echo '<td>'.$array[$i].'</td>'.chr(10); } echo '</tr></table>'.chr(10); ?>