I have written a simple script that acts as a very basic image gallery that basically just reads what files are contained within a directory and displays them as clickable thumbnails which when rolled over display a full size image. [code] <?php while($file = readdir($dh)) { if($file != "." && $file != "..") { $FileName = $file; $NoJPG = str_replace(".jpg","",$FileName); $NoUS = str_replace("_"," ",$NoJPG); print "<td><a href=\"javascript:;\" onmouseover=\"MM_swapImage('MainImage','','gallery/$file',1)\"><img src=\"gallery/thumbs/$file\" border=\"0\" alt=\"$NoUS\"></a></td>"; $sep = ",\n"; } } closedir($dh); ?> [/code] At the moment the images are dispolyed in table cells that spread across the page horizontally, what i would like to be able to do is display the results in a four column table with as many rows as is needed. Any ideas??