note 79661 deleted from language.operators.arithmetic by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 15:54:42 +0000 |
| Subject: | note 79661 deleted from language.operators.arithmetic by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133586@lists.php.net to get a copy of this message | ||
Note Submitter: chris at chrisboshuizen dot com
Reason: 1
----
An even easier way to alternate rows in a table is to define two styles (you can leave one out or
leave it empty)
.row_0 {}
.row_1 {background-color:#AAAAFF}
And then just use the modulus operator % as such:
<?php
for ($count=1; $count < 30; $count++) {
print '<tr class="row_{$count%2}">';
// etc...
}
?>