08-19-2008, 11:48 PM
|
#6 (permalink)
|
|
The Wanderer
Join Date: Apr 2008
Posts: 7
Thanks: 0
|
Maybe even a bit shorter, from Xenon example:
PHP Code:
<style type="text/css"> .odd{background-color: green;} .even{background-color: blue;} </style> <table border="0" cellpadding="0" cellspacing="0" style="width:100%;"> <?php $bg = '#fff'; $x = 0; while($x <= 10){ $class=($x%2!==0)?'even':'odd'; ?> <tr class="<? echo $class;?>"> <td>abc</td> </tr> <?php $x++; } ?> </table>
|
|
|
|