In sqlstyledtable.php:Alternate rows with background colour

  1. add a line to create a variable $rowclass just before the while loop and put an empty string in it: $rowclass="";
  2. find where the opening tr is inside the loop and change it from echo "<tr>"; to echo "<tr{$rowclass}>";
  3. right at the end of the loop but before the closing brace add this:
if ($rowclass=="") {
    $rowclass=" class=\"greybg\""; 
} else {
    $rowclass=""; 
}

In the style element near the top of the code add this:

.greybg {
    background-color:#CCCCCC;
}

The first time through the loop there is nothing in the variable so there is no change to the final HTML page.  At the end of that though the new if statement will look in $rowclass, see it is empty and put something in it.  The new something is a class (with a space before it).  Next time through the loop that class will be put into the HTML by the echo.  Then at the end the new if will make $rowclass empty again.  That way every other row will have the class.  Try it.

When there are many rows in a table most people struggle to follow a row across without jumping to the next (or previous one) by accident.  Making alternate rows different like this can help.