alternating colors

From: Date: Thu, 19 Oct 2000 23:32:37 +0000
Subject: alternating colors
Groups: php.general 
Request: Send a blank email to php-general+get-21301@lists.php.net to get a copy of this message
I am trying to alternate table bgcolor with each iteration of the following loop: print "<td><b>One</b></td>\n<td><b>Two</b></td>\n<td><b>Three</b></td>\n</tr>"; foreach ($list as $row) { print "<tr>\n"; print "<td> $row[one] </td>\n<td> $row[two] "; print " </td>\n<td> $row[three] </td>\n</tr>\n<tr><td colspan=3> $row[four] </td>\n</tr>\n"; print "<tr>\n<td colspan=3> $row[five] </td>\n"; print "</tr>\n"; } print "</table>"; So that every three rows will be a single grouped color different from the next three rows. Does anyone know how to do this ? Thanks rodney

« previous php.general (#21301) next »