in reply to alternating row colors
or remove the $i altogether and domy $i = 0; while( @data = $query->fetchrow ) { $rowcolor = $i++%2 ? $color1:$color2; print REPORT_FILE qq( <tr> <td width=400 align=left, color=$rowcolor>$data[0]</td> <td width=50 align=left>$data[1]</td> <td width=50 align=left>$data[2]</td> <td width=50 align=left>$data[3]</td> <td width=50 align=left>$data[4]</td> </tr> ) }
--traveler <bold>update:</bold> Of course, this does have elements of others' posts (e.g Masem and Russ). It's just a different way to do it.while( @data = $query->fetchrow ) { $rowcolor = $rowcolor == $color2 ? $color1:$color2; print REPORT_FILE qq(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: alternating row colors
by qball (Beadle) on May 18, 2001 at 02:11 UTC |