Re: Re[2]: [PHP] How to format every secound row in a database result

2005-04-05 Thread Richard Lynch
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

Re: [PHP] How to format every secound row in a database result

2005-03-30 Thread tg-php
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

[PHP] How to format every secound row in a database result

2005-03-30 Thread Philip Thompson
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

Re[2]: [PHP] How to format every secound row in a database result

2005-03-30 Thread Richard Davey
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

Re: [PHP] How to format every secound row in a database result

2005-03-30 Thread Leif Gregory
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

Re: [PHP] How to format every secound row in a database result

2005-03-30 Thread Martin . C . Austin
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

Re: [PHP] How to format every secound row in a database result

2005-03-30 Thread Miles Thompson
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

Re: [PHP] How to format every secound row in a database result

2005-03-30 Thread Jochem Maas
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

[PHP] How to format every secound row in a database result

2005-03-30 Thread Georg
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