 | |  |
 |

s2smedia
User
Nov 25, 2008, 7:46 AM
Post #1 of 3
(364 views)
Shortcut
|
|
display pics in rows
|
Can't Post
|
|
I have a photo upload section where i want each photo to show up horizonal instead of vettically... I need each row to have 3 pics... after the 3rd pic i need it to repeat a new row here is my code but it keeps adding the pics to the same row after the 3rd one: <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <?php foreach ($photo_galleryRecords as $record): ?> <td><?php foreach ($record['image_uploader'] as $upload): ?> <?php if ($upload['hasThumbnail']): ?> <a href="<?php echo $upload['urlPath'] ?>" rel="lightbox" title="<?php echo $record['title'] ?>"> <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /></a></td> <?php endif ?> <?php endforeach ?> <?php endforeach; ?> </tr> </table> <br/> <?php if (!$photo_galleryRecords): ?> <span class="bodytext">No Photos Available!</span><br/><br/> <?php endif ?>
|
|
|  |
 |

Dave
Staff
/ Moderator

Nov 25, 2008, 9:41 AM
Post #2 of 3
(360 views)
Shortcut
|
|
Re: [s2smedia] display pics in rows
[In reply to]
|
Can't Post
|
|
Hi s2smedia, Try this:
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr> <?php foreach ($photo_galleryRecords as $record): ?> <?php foreach ($record['image_uploader'] as $upload): ?> <td><a href="<?php echo $upload['urlPath'] ?>" rel="lightbox" title="<?php echo $record['title'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /></a></td> <?php $maxCols=3; if (@++$count % $maxCols == 0): ?> </tr><tr> <?php endif ?> <?php endforeach ?> <?php endforeach; ?> </tr></table><br/> Let me know if that does what you want. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

s2smedia
User
Nov 25, 2008, 10:06 AM
Post #3 of 3
(357 views)
Shortcut
|
|
Re: [Dave] display pics in rows
[In reply to]
|
Can't Post
|
|
As always...your right on the money!!! Thanks Dave!!
|
|
|  |
|