Anything's possible. While you're walking through the resultset of the query to build the table, you can keep a counter and a variable $color and use it like
$counter = 0;
for every_result {
if ($counter%2) {
$color = "black";
} else {
$color = "white";
}
$tablerow = "<tr bgcolor=\"$color\">".doSomeStuff()."</tr>";
print $tablerow;
$counter++;
}
I know 'for every_result' is not correct PHP, but I forgot the exact syntax 😉