Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table & delay question

    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.

    PHP Code:
        <table border="0" cellspacing="5" cellpadding="5" align="center">
            <tr>
                <th><?=mysql_field_name($resultat0);?></th>
                <th><?=mysql_field_name($resultat1);?></th>
                <th><?=mysql_field_name($resultat2);?></th>
                <th><?=mysql_field_name($resultat4);?></th>
                <th><?=mysql_field_name($resultat3);?></th>
                <th><?=mysql_field_name($resultat5);?></th>
            </tr>
        <?
        
    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>";
        
    ?>
        </table>    
        </td>
      </tr>
    </table>

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something like this should work:

    PHP Code:
    $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>"
            
    $x++;
        } 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

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Worked very nice...thank you so much! /bow


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •