Help sorting images into columns

2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 11, 2008   (RSS)

By _kate_ - November 11, 2008

I've used this code quite a few times, however when trying to use it for the image gallery on a new site I've run into some problems - the images are still displaying one underneath each other and not into columns. I'm sure it's something simple but I just can't figure out what I've done wrong!! Can anyone point me in the right direction? Thanks!


<table border="0" cellpadding="0" cellspacing="0">
<tr>
<?php foreach ($galleryRecords as $record): ?>
<span class="heading"><?php echo $record['title'] ?></span><br/>
<td width="200" align="center" valign="top" style="padding-bottom: 16px;">

<?php foreach ($record['photos'] as $upload): ?>
<a href="<?php echo $upload['urlPath'] ?>" class="Images" rel="facebox"><img src="<?php echo $upload['urlPath'] ?>" width="100" style="margin: 0 0 10px 20px" /></a><br/>
</td>

<?php $maxCols=3; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>
<?php endforeach ?>
<?php endforeach; ?>

<?php if (!$galleryRecords): ?>
There are currently no photos. Please check this page again shortly.
<?php endif ?>

</tr>
</table>