note 41494 deleted from ref.strings by tomsommer

From: Date: Wed, 15 Sep 2004 20:47:02 +0000
Subject: note 41494 deleted from ref.strings by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-76784@lists.php.net to get a copy of this message
Note Submitter: baparrish at hotmail dot com ---- Here's the simplest way I've found to alternate row colors in a dynamically generated HTML table. If the row number is even then ($row_number % 2) will always return zero. <?php function row_color($row_number) { if((($row_number % 2) == 0)) { // row is an even number $color = '#000000'; } else { // row is an odd number $color = '#ffffff'; } return $color; } ?>

« previous php.notes (#76784) next »