change color every 2 rows *SOLVED*

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Da_Elf
Forum Commoner
Posts: 81
Joined: Mon Dec 29, 2008 12:31 pm

change color every 2 rows *SOLVED*

Post by Da_Elf »

i know about this
($attendcolor%2 == 0)
but i want it to be
row 1 and 2 white
row 3 and 4 black
row 5 and 6 white etc.
%3 doesnt work nor %4
Last edited by Da_Elf on Sat Dec 31, 2016 1:00 pm, edited 1 time in total.
Da_Elf
Forum Commoner
Posts: 81
Joined: Mon Dec 29, 2008 12:31 pm

Re: change color every 2 rows

Post by Da_Elf »

sorry. solved it myself with this

if (($attendcolor - 1) % 4 < 2)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: change color every 2 rows *SOLVED*

Post by requinix »

CSS can do it better.
Post Reply