1 May 2010 01:14
Re: Two color rows in table inside while iteration -- just say no to mod
Jason Pruim <lists <at> pruimphotography.com>
2010-04-30 23:14:02 GMT
2010-04-30 23:14:02 GMT
On Apr 30, 2010, at 4:20 PM, Daevid Vincent wrote:
>> -----Original Message-----
>> From: Ashley Sheridan [mailto:ash <at> ashleysheridan.co.uk]
>>
>> Modulus is the most elegant solution I reckon. Imagine if you only
>> needed to highlight every 3rd row, or 4th? Easy to change the modulus
>> for it, not so easy to re-work a binary switch.
>>
>> -----Original Message-----
>> From: Richard Quadling [mailto:rquadling <at> googlemail.com]
>>
>> The modulus is a good option when there are more than 2 states.
>>
>> Say a 5 row fade ...
>>
>> $a=0;
>> while ($row=mysql_fetch_...){
>> echo "<tr class=??????\"alternate-row-".(1 + (++$a%5))."\"><..."
>> }
>>
>> giving alternate-row-1, alternate-row-2, alternate-row-3,
>> alternate-row-4 and alternate-row-5
>
> Okay, how many tables do you EVER see with more than TWO colors?
> Come on
> now.
>
> Show me some URL's to REAL sites (not some contrived examples) that
(Continue reading)
RSS Feed