|
Posted by Toby A Inkster on 05/18/07 07:31
bokke wrote:
> $row = 1-$row;
> $color = ($row==0)?"#F5F5F5":"#F0F8FF";
This is bizarre. It took me a couple of minutes to figure out how it
worked. A more usual method might be:
$color = (++$row%2 == 1)?'#F5F5F5':'#F0F8FF';
This would also allow you to count the rows in $row, which might be useful
for some reason.
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
Navigation:
[Reply to this message]
|