
February 14th, 2003, 12:47 PM
|
 |
funky munky
|
|
Join Date: Jul 2001
Location: UK
Posts: 1,446
  
Time spent in forums: 2 Days 18 h 45 m 36 sec
Reputation Power: 14
|
|
If you setup two different CSS ids:
.tr0 {
background-color: <?php print($VISUALS[$SkinID]['page']['background-color0']); ?>;
}
.tr1 {
background-color: <?php print($VISUALS[$SkinID]['page']['background-color1']); ?>;
}
then in the code where you output the rows of your table (presuming they're coming from an array of results):
PHP Code:
$toggle=0;
foreach($row_array as $row){
print("<tr id=tr$toggle><td>$row[0]</td><td>$row[1]</td></tr>\n");
$toggle=($toggle+1)%2;
}
you should get the effect you're after (although I'm no CSS master, so you'd have to figure that out - hey what you expect on a php forum;-)
EDIT: the $toggle=($toggle+1)%2 just sets the value of $toggle to 0 if it's current value is 1 and vice-versa.
Last edited by munkfish : February 14th, 2003 at 06:11 PM.
|