View Full Version : Table & delay question

07-01-2005, 10:30 AM
First: While entering my test-site (http://minmening.com/matlistan) using Firefox I get a delay while clicking on options and the textbox and such. But using IE I sence no delays at all, anyone got an answer for this?

Second: I have a table-code looking like the one below. My problem is here that I wan't each second row to have a bit darker background-color so users easily can read the table. Now...how is this done. I have done it before but just can't figure it out now.

<table border="0" cellspacing="5" cellpadding="5" align="center">
<th><?=mysql_field_name($resultat, 0);?></th>
<th><?=mysql_field_name($resultat, 1);?></th>
<th><?=mysql_field_name($resultat, 2);?></th>
<th><?=mysql_field_name($resultat, 4);?></th>
<th><?=mysql_field_name($resultat, 3);?></th>
<th><?=mysql_field_name($resultat, 5);?></th>
while ($raden = mysql_fetch_row($resultat))
echo "<tr><td>$raden[0]</td><td>$raden[1]</td><td>$raden[2]</td><td>$raden[4]</td><td>$raden[3]</td><td>$raden[5]</td></tr>";

07-01-2005, 11:35 AM
Something like this should work:

$x = 0;
while($raden = mysql_fetch_row($resultat))
if($x == 0) {
echo "<tr bgcolor=\"#EEEEEE\"><td>$raden[0]</td><td>$raden[1]</td><td>$raden[2]</td><td>$raden[4]</td><td>$raden[3]</td><td>$raden[5]</td></tr>";
} else {
echo "<tr bgcolor=\"#CCCCCC\"><td>$raden[0]</td><td>$raden[1]</td><td>$raden[2]</td><td>$raden[4]</td><td>$raden[3]</td><td>$raden[5]</td></tr>";
$x = 0;

Not sure about the delay but it's unlikely to be PHP related since the time delay difference should only be cause by the browser rendering the information it has received from the server - the actual serving of the information shouldn't be different between browsers unless you're handling cookies or sessions or something maybe :confused:

07-01-2005, 11:55 AM
Worked very nice...thank you so much! /bow