[Fwd: Re: [Pugged] Switch Troubles]

Tim Perdue ciapug@ciapug.org
Mon, 24 Mar 2003 16:37:05 -0600


This seems to have gotten lost in the system...

-------- Original Message --------
Subject: Re: [Pugged] Switch Troubles
Date: Mon, 24 Mar 2003 15:18:30 -0600
From: Tim Perdue <tim@perdue.net>
To: ciapug@ciapug.org
References: <E18xXD1-0007y7-00@host2.hostforweb.net> 
<3E7F7551.10109@visionary.com>

David Champion wrote:
> Simpler (pseudo) code:
> 
> $x = 0;
> for ... {
>   $x++
>   if ($x == 1) {
>     $bgcolor = "#aaaaaa";
>     $x = 0;
>   } else {
>     $bgcolor = $defcolor;
>   }
>   //...yada yada yada
>   $rs->MoveNext();
> }

     function boxGetAltRowStyle($i) {
         if ($i % 2 == 0) {
             return 'style="background-color:white"';
         } else {
             return 'style="background-color:' . $this->COLOR_LTBACK1 . '"';
         }
     }


That works too - even numbers are a certain color - odd numbers are the
other color.