On Sat, 2004-06-05 at 11:21, James Kaufman wrote:
> $bgcolor = ($i % 16 > 8) ? #eeeeff : #ffffff;
> print "<tr
> bgcolor='$bgcolor'><td>$item_1</td><td>$item_2</td><td>$item_4</td><td><cen
> ter>$item_5</center></td></tr>\n";

You probably want to do:
$bgcolor = (($i % 16) > 7) ? #eeeeff : #ffffff;

Since $i % 16 will rotate from 0 - 15.  This will work assuming $i
starts at 0.  If not then you should do:
$bgcolor = ((($i - $x) % 16) > 7) ? #eeeeff : #ffffff;
Where $x is whatever value $i started at.  However, I would recommend
using a new counter that starts a 0 and is incremented at the end of
your loop.

Alternatively you could do:
print "<tr
bgcolor='#ffffff'><td>$item_1</td><td>$item_2</td><td>$item_4</td><td><center>$item_5</center></td></tr>\n";
if ($i % 8 == 7) {
print "<tr><td colspan='4'></td></tr>\n";
}

which would keep them the same color and add a blank row after every
eighth; again adjust $i as necessary to fit.

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to