I am not sure I have understood your question, but...
Loop over your images, create a new row only when you have reached 5 images (=5 columns) on the current row... It sounds a little bit confusing, but the following code should explain it better:
- Code: Select all
<table>
<?php
for ($i = 0; $i < mysql_num_rows($sql_results); $i++) {
if ($i % 5 == 0) {
print "<tr>";
}
print '<td><img src="'.$link_to_image_out_of_sql_query.'" alt="" /></td>';
if ($i % 5 == 0) {
print "</tr>";
}
}
?>
</table>
Does it fulfill your expectations?
/Flood

