note 79661 added to language.operators.arithmetic
| From: | chris at chrisboshuizen dot com | Date: | Fri, 07 Dec 2007 02:13:09 +0000 |
| Subject: | note 79661 added to language.operators.arithmetic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132915@lists.php.net to get a copy of this message | ||
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...
}
?>
----
Server IP: 203.202.10.60
Probable Submitter: 124.170.16.157
----
Manual Page -- http://www.php.net/manual/en/language.operators.arithmetic.php
Edit -- https://master.php.net/note/edit/79661
Del: integrated -- https://master.php.net/note/delete/79661/integrated
Del: useless -- https://master.php.net/note/delete/79661/useless
Del: bad code -- https://master.php.net/note/delete/79661/bad+code
Del: spam -- https://master.php.net/note/delete/79661/spam
Del: non-english -- https://master.php.net/note/delete/79661/non-english
Del: in docs -- https://master.php.net/note/delete/79661/in+docs
Del: other reasons-- https://master.php.net/note/delete/79661
Reject -- https://master.php.net/note/reject/79661
Search -- https://master.php.net/manage/user-notes.php