I use code as below to give alternate rows of white and light grey backgrounds to enhance reading of information.
Immediately after you access the database and send the SQL query to extract data construct the table to display the results:
echo "<h1>Online User Access Listing</h1>";
echo "<table width='95%' border='0' align='center'>";
echo "<tr align='left'><th width='100'>Login Code</th><th width='200'>Password</th><th>Status</th><th>Visits</th><th>Last Date</th><th width='80'>Action</th></tr>";
while ($row = mysql_fetch_array($result)) {
extract($row);
if ($alternate =="1") { //alternate coloured lines
$colour = "#ffffff";
$alternate = "2";
}
else {
$colour ="#F3F3F3";
$alternate = "1";
}
//display rows of data
echo "<tr bgcolor=$colour>
<td><a href='cust_update.php?cust_code=$cust_code'>$cust_code</a></td><td>$passwrd</td><td>$status</td>
<td>$access</td><td>$lastdate</td><td><a href='user_update.php?cust_code=$cust_code'><font size='-1'>Update Access</font></a></td></tr>";
}
echo "</table>";