php4-beta | 200004
Date: 04/27/00
- Next message: David Robley: "Re: [PHP4BETA] A (Hopefully) simple question *gulp*"
- Previous message: John Steele: "Re: [PHP4BETA] A (Hopefully) simple question *gulp*"
- In reply to: John Steele: "Re: [PHP4BETA] A (Hopefully) simple question *gulp*"
- Next in thread: David Robley: "Re: [PHP4BETA] A (Hopefully) simple question *gulp*"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks, John. Always fun to see the different ways of doing things.
What's that old saying about the cat? =)
Cheers,
Bradley
----- Original Message -----
From: John Steele <overlord <email protected>>
To: <php4beta <email protected>>
Sent: Friday, April 28, 2000 4:55 AM
Subject: Re: [PHP4BETA] A (Hopefully) simple question *gulp*
> David,
>
> >Yup. Initialise a counter then increment it for each table row you
> >display. Then, on each row, test the counter value mod 2. If the result
> >is zero, use one colour for row background, otherwise use the other
> >colour.
>
> Here's another simple way to let the colors do the work. It can be made
into a pretty sick one-liner :)
>
> <?
> $color1 = "#ffffff";
> $color2 = "#E1DAC1";
> ?>
> <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1>
> <TR>
> <TH>Blah</TH><TH>Blah2</TH>
> </TR>
> <?
> $color = "";
> for ($i=0;$i < $num; $i++) {
> $color = ($color == $color1) ? $color2 : $color1;
> echo "<tr bgcolor=\"$color\"><td>yada</td><td>spew</td></tr>
> // more stuff
> }
> ?>
> </table>
>
> Cheers,
> John
> --
> /* SteeleSoft Consulting John Steele - Systems Analyst/Programmer
> * We also walk dogs... jsteele <email protected>
> * http://www.gamecomputer.com/ssc/
> */
>
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
> For additional commands, e-mail: php4beta-help <email protected>
> To contact the list administrators, e-mail: php4beta-admin <email protected>
>
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe <email protected> For additional commands, e-mail: php4beta-help <email protected> To contact the list administrators, e-mail: php4beta-admin <email protected>
- Next message: David Robley: "Re: [PHP4BETA] A (Hopefully) simple question *gulp*"
- Previous message: John Steele: "Re: [PHP4BETA] A (Hopefully) simple question *gulp*"
- In reply to: John Steele: "Re: [PHP4BETA] A (Hopefully) simple question *gulp*"
- Next in thread: David Robley: "Re: [PHP4BETA] A (Hopefully) simple question *gulp*"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

