Re: Row colors
| From: | Gfunk | Date: | Mon, 09 Apr 2001 00:10:58 +0000 |
| Subject: | Re: Row colors | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47688@lists.php.net to get a copy of this message | ||
see changes
----------------------------------------------------------------------------
Gfunk - josh@gfunk007.com - http://www.gfunk007.com/
----- Original Message -----
From: "Mike P" <mpeloso@princeton.edu>
To: <php-general@lists.php.net>
Sent: Monday, April 09, 2001 10:08 AM
Subject: [PHP] Row colors
> I can change the column sof a table with the following code but how do I
> change the row colors instead.With the columns I have "i" to manipulate
but
> not with rows.
>
$rowcount = 0;
> while ($row = mysql_fetch_row($result))
> {{
$rowcount++;
if ($rowcount%2==1)
echo "<tr bgcolor=\"blue\">";
else
echo "<tr bgcolor=\"white\">";
> for ($i =1;$i<mysql_num_fields($result);$i++)
> {$cell_color = "#C0C0C0";
> $i % 2 ? 0: $cell_color = "#CCCCCC";
> echo "<td bgcolor=\"$cell_color\">$row[$i]</td>";
> Thanks
> Mike P
> mpeloso@princeton.edu
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>