Re: task Scheduler driving me crazy!
| From: | tedd | Date: | Tue, 03 Jul 2007 18:36:58 +0000 |
| Subject: | Re: task Scheduler driving me crazy! | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258171@lists.php.net to get a copy of this message | ||
At 5:05 PM +0300 7/3/07, Andrei wrote:
Anyway you should get rid of echoing everything from php... It really gets you mad when you want to change things... while($row = mysql_fetch_array($result)) {Andrei: Well don't -- use css instead: First, define a background-color in a css class, like so: .myRow0 { background-color: yellow; } .myRow1 { background-color: red; } Then in your php, assign: $rowColor = 'myRow0'; // actually this is column color and not row color?><TR><TD bgcolor="<?=$rowColor?>">ID#, <?=$row[0]?></td> <td bgcolor="<?=$rowColor?>">TicklerName, <?=$row[1]?></td> etc...</tr> <? }
?><TR>
<TD class="<?=$rowColor?>">ID#, <?=$row[0]?></td>
<td class="<?=$rowColor?>">TicklerName, <?=$row[1]?></td>
etc...
</tr>
<?php
Also, I wouldn't use short tags.
Plus, to alternate color *rows* in a table, just use:
<tr class="myRow<?php echo($i++ & 1 );?>">
<td whatever...
</tr>
See it work here:
http://www.webbytedd.com/b/color-rows/
It works better than anything I've read thus far.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com