[FX.php List] Newbie Needs Help

Andy Gaunt andy at fmpug.com
Tue Oct 18 07:55:30 MDT 2005

Lars –


I would recommend looking at the code I posted. This allows you to reuse the
alternating color technique on multiple items without having to enter the
counter info each time.


Andy Gaunt

T: 407.810.4722

andy at fmpug.com



Recipient of FileMaker’s 2005 “Mad Dog” Public Relations Award


October 27th 2005, 6pm Orlando FMPug – What’s Hot for FileMaker Developers,
a presentation of FileMaker 8 Advanced features.

For other chapter locations, dates & times please visit the website at

If you can make it to a meeting, please RSVP at



From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Lars Arl é r
Sent: Tuesday, October 18, 2005 4:13 AM
To: FX.php Discussion List
Subject: Re: [FX.php List] Newbie Needs Help


> 1. The data rows displayed in alternating colors.

This is how it works for me, and I´m a newbie to and trying to grasp it ;-)
And I like to see exsamples to, so hope this helps you to

 <table width="100%" border="0" cellpadding="2" cellspacing="0">
<? $counter = 0;  foreach ($searchResult['data'] as $key => $searchData) {
if ($counter % 2 == 0) { $rowColor = '#ffffff'; } else { $rowColor =
'#dddddd'; } echo "<tr bgcolor=\"$rowColor\">\n";?>

                       <td width="72" align="left" class="Verdana_gray"><?
echo $searchData['recid'][0]; ?></td>                        <td width="124"
align="left" class="Verdana_gray"><? echo $searchData['category'][0];
?></td>                        <td width="95" align="center"
class="Verdana_gray"><? echo $searchData['stamp_text'][0]; ?></td>
<? echo "</tr>\n";                        ++$counter;
}?>    </table>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20051018/f5f59b3c/attachment-0001.html

More information about the FX.php_List mailing list