$i = 1; echo ''; while ($a = mysql_fetch_array($cat)) { echo "\t" . $a[navn] . "\r\n"; if ($i % 3 == 0) echo "\r\n"; $i++; } echo '';