> Is there any function to tell if a number is even or odd?
> I am looking for an easy way to loop through a list and
> output table cell bgcolor based on even / odd.
>
> if its an even numbered row make it red if its odd make
> it blue.
>
> I have done it in the past by turning a switch on or off
> but I think there must be an easier way.
There might an easier way, but you could always use the modulus operator.
if ($number % 2 ) {
# number is even
} else {
# number is odd
}
I guess you could put that in a loop to colour up your cells.
Tor
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]