Re: Two color rows in table inside while iteration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/4/28 Fernando <fernando@xxxxxxxxxx>:
> What about this:
>
> $color = "even";
> while ($row = while condition )) {
>       $color = ($color == "even") ? "odd" : "even";
>       echo ("<tr class=\"$color\">");
>       echo "<td>$row[0]</td><td>$row[1]</td>
>  <td>$row[2]</td><td>$row[3]</td><td>$row[4]</td>  ";
>       echo ("</tr>")
> }
>
> And have two classes in your style sheet that format each row differently.
>
> Hope this helps.

Thanks to all guys!. Now it's working perfectly as I wanted.

Also was interesting to read the points you showed about JS and PHP.

Best,
Juan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux