RE: Alternate Colors in Rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add this to your default.css file... Or to the page...

<style>
TR.dataRow1 { background-color: #e8f5f7; } /* light */
TR.dataRow2 { background-color: #dce8ea; } /* dark */
</style>

Then just do this:

<TR class=<?php echo ($r = !$r) ? "dataRow1" : "dataRow2"; ?> > 

Forget all that $i++ and (mod) % stuff...

And NEVER hardcode the colors in the page. Use CSS !


Adjust to use a DIV as needed.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux