using foreach loop to produce table

3 posts by 2 authors in: Forums > CMS Builder
Last Post: February 23, 2010   (RSS)

Re: [jarvis] using foreach loop to produce table

By jarvis - February 23, 2010

Sorted, was missing i++

<table class="client_category" width="600" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle">
<?php $i = 0; ?>
<?php foreach ($clientsRecords as $record):?>
<?php foreach ($record['client_logo'] as $upload):?>
<?php $float = (($i % 5) !== 0) ? '</td><td>' : '</td></tr><tr><td valign="middle">'; ?>
<a href="<?php echo $record['_link'] ?>">
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="<?php echo $record['client_name'] ?>" />
</a>
<?php ++$i; ?>
<?php echo $float; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</td>
</tr>
</table>


Hope that helps someone!

Thanks

Re: [jarvis] using foreach loop to produce table

By Donna - February 23, 2010

Glad to hear you got that sorted out! :)
Donna

--
support@interactivetools.com