Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199903

Re: [PHP3] displaying search results From: Jason Brooke (jason <email protected>)
Date: 03/18/99

Timothy Sarver wrote:
>
> Does anyone have a script that will display the results of a search in
> alternating colors; one row white the next light gray, ect,ect.
>
> Thanks

Use a loop to dynamically build a table, and set the first table row
color before the loop:

$rowcolour = "#CCCCCC";

for (....) {

print("
<tr rowcolor=\"$rowcolor\">
<td>foobar</td>
</tr>
");

        switch($rowcolour) {
                case "#CCCCCC":
                        $rowcolour = "#FFFFFF";
                        break;
                case "#FFFFFF":
                        $rowcolour = "#CCCCCC";
                        break;
        }

}

Jason

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev-list-admin <email protected>