03-22-2005, 02:48 PM
|
#3 (permalink)
|
|
The Visitor
Join Date: Mar 2005
Location: WW, WA
Posts: 3
Thanks: 0
|
The code I use normally for something like that is...
PHP Code:
// Initialize Vars
$rowEven = 0;
do {
// If odd, use white, if even use black
if(!$rowEven) {
$rowEven = 1;
$bgColor = "white";
}
else {
$rowEven = 0;
$bgColor = "black";
}
echo "<tr><td style=background-color: $bgColor>Text</td></tr>";
} while (...);
Obviously my version is a longer way of doing it compared to AlEast's, so you may stick with his version, I just find it easier to read when done in this fashion. :)
NS
Last edited by NotteScura : 03-22-2005 at 02:50 PM.
|
|
|