Re: Row colors
| From: | Jason Stechschulte | Date: | Mon, 09 Apr 2001 11:52:58 +0000 |
| Subject: | Re: Row colors | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47763@lists.php.net to get a copy of this message | ||
On Mon, Apr 09, 2001 at 12:08:10AM +0000, Mike P wrote:
> 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.
>
> while ($row = mysql_fetch_row($result))
> {{
> echo "<TR>\n";
> for ($i =1;$i<mysql_num_fields($result);$i++)
This works for me.
echo "<td ".($i & 1 ? "bgcolor=c0c0c0" :
"bgcolor=cccccc").">";
--
Jason Stechschulte
jpstech@unoh.edu
--
Any false value is gonna be fairly boring in Perl, mathematicians
notwithstanding.
-- Larry Wall in <199707300650.XAA05515@wall.org>