Output zebra stripe rows in PHP


/ Published in: PHP
Save to your folder(s)

This is a simple way to stripe alternate rows of output or to do anything different as I process each alternate row. Typically, I set the element's class to "myEvenRow" or "myOddRow" then output the data just after the IF statement.

I found this full example at nullislove.com. The page also has a Ruby example. Full props to them.

URL: http://www.nullislove.com/2007/05/09/zebra-striping/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.