[thelist] simple! PHP data display

Jon Haworth jhaworth at witanjardine.co.uk
Thu Aug 22 10:05:02 CDT 2002


Hi R.,

> // toggle colours
> $currColour==$colour1 ? $currColour=$colour2 : $currColour=$colour1;
>
> echo "<td bgcolor=\"$currColour\">\n";
>
> etc...
>
> Has the advantage of specifying the colours outside of the loop so you
> can change them globally if you wanted to.

Personally I'd use a stylesheet and switch classes instead of bgcolors, but
I definitely agree with the necessity to avoid magic numbers wherever
possible :-)

Cheers
Jon



More information about the thelist mailing list