I want to arrange images so that I can place two across, and then to the next line. The image information is going to be gathered from a database, and basically I need a new <tr> every two images.
Anyone have any ideas on how to work this one out?
Arranging Images
Moderator: General Moderators
you can use the modulus operator to seperate "even/odd" entries.
e.g.
e.g.
Code: Select all
<html><body>
<pre>
<?php
$dummy = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h');
$i = 0;
foreach($dummy as $d)
{
if ($i++ % 2 == 0)
echo "--break--\n";
echo $d, "\n";
}
?>
</pre>
</body></html>