News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

MSBWare.com:
Alternating Row Colors
May 02, 2007 @ 16:13:00

Sometimes, a simple approach is the best. That's what Michael Berman went with in this light and easy tutorial. It focuses on the creation of an "alternating rows" script with PHP.

This concept is used all over the internet. Almost every database driven website uses alternating row colors when displaying a list of records. You've seen it used, you like it, and now you want to do it yourself. But, you're not sure how to accomplish it. Well you've come to the right place. I'm going to discuss the basic idea behind achieving this and give some concrete examples demonstrating different ways to implement it.

The example code show how to alternate between two colors - white and grey - for the background of a series of DIVs. He even includes a series of tests to show which method of switching them out would be faster (while loop, for loop, etc).

0 comments voice your opinion now!
alternate row color loop benchmark tutorial alternate row color loop benchmark tutorial


blog comments powered by Disqus

Similar Posts

Gonzalo Ayuso: Building a Silex application from one Behat/Gherkin feature file

Developer Tutorials: Zend Framework Tutorial

Gergely Hodicska's Blog: What's new in PHP 5.3 - part 1: namespaces

DevShed: Using Recursive Methods in Object-based PHP Applications (Part 2)

PHP-GTK Blog: How to: PHP 5.3 with PHP-GTK and Cairo on Linux Mint 9


Community Events





Don't see your event here?
Let us know!


series framework unittest language threedevsandamaybe developer release introduction interview podcast opinion list laravel install refactor code configure community testing wordpress

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework