Hello, I am trying to get the results from a mysql database and display them into a table like structure but not with a table, instead I want to use DIV tags instead of using a table. I only want to have 1 image per DIV tag. I will have many rows, but I only want 3 columns. I want each row to display as such:
EXAMPLE #1 - Is what I want
Column 1 Column 2 Column 3
Picture1 Picture2 Picture3
Picture4 Picture5 Picture6
Picture7 Picture8 Picture9
The problem is the code I have does not do this, it only displays 3 of my images and no more. Here is my code below (I have included ONLY the pertinent css and and php code that I am using), please help me do what I have asked above, please?
CSS CODE:
.clear{
clear:both;
}
.galCol{
float:left;
width:110px;
padding:10px;
}
PHP CODE:
while($row = mysql_fetch_array( $result )) {
if($i < 3){
echo'<div class="galCol">
<a href="./photos/'.$row['gal_Img_Image'].'" rel="lightbox(BigDC)" title="'.$row['gal_Img_Caption'].'"><img src="./photos/'.$row['gal_Img_Image'].'" alt="" width="100" height="100"/></a>
</div>';
$i += 1;
}else{
echo'<div class="clear"></div>';
$i = 1;
}
}
Please help me correct my php code to do as I have asked above, please?