Forum Moderators: coopster
I have a dynamic table - lots of rows that can change any time.
I would like to add a striped effect to the table but am a little unsure how to do it.
I have a counter so i was thinking would it be possible to have an if statements like this
if($counter==(A MULTIPLE OF 2)){Echo bgcolor="red";}else{echo bgcolor="blue";}
Is there a function that can check for this multiple of 2?
or is there a completely different way of doing this that any anyone is aware of?
thanks guys
try this tutorial...
Just a thought... the tutorial discusses the principle of using the modulus operator (%) to find the remainder when dividing by 2 (to find odd and even rows). Fine. However it also talks about using the deprecated bgcolor attribute to hard code the colour on the element. Not so good. It would perhaps be better to assign a class instead which defines the background-color in your stylesheet.