Photo Gallery

My mind has gone blank with tables as I use css.
You will need to add a count and after every so many images echo a </tr><tr> but it gets more complicated as you need a starting <tr> on its own and a finishing </tr> on its own.

I use a container div and then put the images in the div; this means the images automaticaly wrap to fit the div.


#thumbnail_div {float: left;
	width: 378px ;
	margin-left: 0 ;
	text-align: left;
	padding: 10px 0 10px 0;
}
.thumbnail
{
	float: left;
	height: 110px;
	margin: 0 0 2px 0;
	text-align: center;
}


	<div id="thumbnail_div">		

<?php

$result = mysql_query("SELECT * FROM photo WHERE catagory = '$cat' ORDER BY path");
			while($row = mysql_fetch_array($result))
{
// Just fix the height or else if the widths and heights vary the photo will be distorted
echo "<div class=\\"thumbnail\\">\
<a href='viewphoto.php?photo=".$row['path']."'><img src='".$row['path']."'></a></div>";
}
?>
<div style="clear:both;"></div>
</div>

On my Latest gallery I resize the images up upload and put them on “standard” size canvases which makes for a nice neat layout: My gallery main page