|
<?php function everyother($bgcolor) {
static $counter=0;
if ($counter % 2 == 0) {
echo "$ind<tr style="background-color:$bgcolor">n";
} else {
echo "$ind<tr style="background-color:#ffffff">n";
}
$counter++;
} ?>
|
|
|
Usage Example
|
echo "<table>";
$q = mysql_query("SELECT * FROM table");
while($r = mysql_fetch_object($q)) {
everyother("#eeeeee");
echo "<td>$r->name</td>";
echo "</tr>";
}
echo "</table>";
|
|
|
Rate This Script
|
|