On Wed, March 30, 2005 11:08 am, Richard Davey said:
> Hello Leif,
>
> Wednesday, March 30, 2005, 6:54:15 PM, you wrote:
>
> LG> http://www.devtek.org/tutorials/alternate_row_colors.php
>
> There is no need to involve a math heavy modulus function just to
> alternate row colours! The following sing
I've used the mod (%) function to do this, which also gives you the flexibility
of defining how many lines to alternate the colors or do whatever you need to
do every "X" lines.
Another method (and forgive me if this was mentioned, I didn't see it yet) is
to use a bitwise NOT to flip-flop a val
On Mar 30, 2005, at 12:08 PM, Richard Davey wrote:
Hello Leif,
Wednesday, March 30, 2005, 6:54:15 PM, you wrote:
LG> http://www.devtek.org/tutorials/alternate_row_colors.php
There is no need to involve a math heavy modulus function just to
alternate row colours! The following single line will do it
Hello Leif,
Wednesday, March 30, 2005, 6:54:15 PM, you wrote:
LG> http://www.devtek.org/tutorials/alternate_row_colors.php
There is no need to involve a math heavy modulus function just to
alternate row colours! The following single line will do it just as
well, swap the colours for whatever you
Hello Georg,
Wednesday, March 30, 2005, 8:05:30 AM, you wrote:
G> I wish to format the output of a database select. The result is
G> presented in a table, in which i'd like to present everey secound
G> row with a different background color. My idea was to test if the
G> remaining number of rows wh
ly wrong in this approach, but it has
always worked for me. :o)
Martin Austin
Miles Thompson <[EMAIL PROTECTED]>
03/30/2005 10:18 AM
To: php-general@lists.php.net
cc:
Subject: Re: [PHP] How to format every secound row in a
database result
Maintain
Maintain a counter as you display the returned results.
Mod the counter by 2 (rowcounter % 2), set colour according to presence /
absence of a remainder.
Miles
At 11:05 AM 3/30/2005, Georg wrote:
Hi!
I wish to format the output of a database select.
The result is presented in a table, in which i'd
Georg wrote:
Hi!
I wish to format the output of a database select.
The result is presented in a table, in which i'd like to present everey
secound row with a different background color.
My idea was to test if the remaining number of rows where a prime number or
modulo 2 is the current row 'num
Hi!
I wish to format the output of a database select.
The result is presented in a table, in which i'd like to present everey
secound row with a different background color.
My idea was to test if the remaining number of rows where a prime number or
not, and by that determent if the background colo
9 matches
Mail list logo