This is the only way I could figure this out.
Is this a good way to go about it? I dont know if I have errors or not.
Is there perhaps an easier way?
I tried to make it decide by even/odd #'s skipping 0
(I dont know how to work the even/odd thing very well so i hope its right)
then place this in the page:PHP Code:<?php
function row($y) {
echo $y++;
return $y;
}
$y = 1;
if ($y% 2 == 0 ) {
echo "#fff";
}
else {
echo "#000";
}
?>
And place this in the style:PHP Code:<?php include_once ("color-rows.php"); ?>
PHP Code:<div style="background-color:"<?php $y= row($y); ?>;">









.... just do a compare... % is more cpu intensive than a simple compare (not much, but its obviously in a loop);

Bookmarks