OK, so on my site, i have an image gallery which gets the image information from a mysql database, then i use php to display the information
but ATM i have them all going down in a list like
#
#
#
#
# representing image
but i would like it in a table with 4 columns that creates a new row on every multiple of 4
eg
# # # #
# # #
etc
how can i do this in php, thanks in advance
here's my code, yes the html is bad
code:
$i=0;
while ($i < $num) {
$Desc=mysql_result($result,$i,"Desc");
$File=mysql_result($result,$i,"File");
$Type=mysql_result($result,$i,"Type");
$Date=mysql_result($result,$i,"Date");
if ($Type=="vid") {
echo "<div align='center'><img src='Media/video.jpg'><br />Description : $Desc<br /><br /><a href='Media/$File' target='_blank'>View Video</a><br />Added On $Date<br />-----<br /></div><br /><br />";
} else {
echo "<div align='center'><img src='Media/$File' width='200' height='150' border='1'><br />Description : $Desc<br /><br />Filename : $File<br /><br /><a href='Media/$File' target='_blank'>Click to see full size picture</a><br />Added On $Date<br />-----<br /></div><br /><br />";
}
$i++;
}
?>