On Friday 17 January 2003 20:11, Denis L. Menezes wrote: > Hello Guys, > > I want alternating colours in the output table. Can someone tell me what is > wrong with this code? I get the data but no alternating colours. > > Quote : > > <?php > $cols = array('#ff0000','#00ff00'); > $i = 0; > while($row=mysql_fetch_array($result)){ > echo '<tr bgcolor="'.$cols[$i++%2].'">';
Look at the HTML source of the resulting page, if each <tr bgcolor...> is alternating then your code is working. Which means your HTML is dodgy ... > Print "<td width=\"12%\" align=\"center\" height=\"6\" > bgcolor=\"#FFFFbf\"><font face=\"Tahoma\" color=\"#000000\">" ; Print -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* There are no winners in life, only survivors. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php