PHP, Displaying Images, Help

Associate
Joined
29 May 2005
Posts
144
Hello. ;)

I'm currently working on a simple gallery script to display thumbnail images on a webpage. The actual script is working fine, and is displaying the thumbnails (150x150) perfectly, but in the wrong 'layout' to what I would like.

I’m trying to achieve a gallery like the below (REF1), but have only managed to successfully do (REF2). I’m totally stuck and lost on how to achieve it horizontal for 4 images, before then going vertically.

As i said, the actual code is working and displaying the images fine, it’s just really the layout as such, which I’m having problems with.

Any help would be greatly appreciated.

Thanks Again, MoFish

Here is my code:

Code:
<?
$error = '';

$findall = mysql_query("SELECT * FROM `gallery`");

	if ($myrow = mysql_fetch_array($findall)) {
		while ($myrow = mysql_fetch_array($findall)) {
			$author = $myrow["author"];
			$image = $myrow["image"];
			$id = $myrow["id"];
			
				echo "<table width='100%' border='0' cellspacing='0'>";
 				echo "<tr align='left' style='border:1px solid black'>			
   					<td align='left'><a href='gallery/$image'><img src='gallery/tn_$image' /></a></td>
    				<td align='right'><div>$image</div></br>Image Posted By <b>$author</b></td>
  		 			 </tr>";	
		}
	echo "</table>\n";	
	
	} else {
		echo '<p style="background-color:FDC4C5; border: 1px dotted;">no images found in gallery</p>';
}
?>

REF1

want.jpg


REF2

current.jpg
 
Back
Top Bottom