[eluser]Beginers[/eluser]
You may try this method:
(correct me if i misunderstand your question)
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Alternating Color</title>
<style type="text/css">
.gray{
background:#a3a3a3;
}
.green{
background:#a8fe9f;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Alternate Color</th>
</tr>
</thead>
<tbody>
<?php for($i=0;$i<=10;$i++):?>
<tr class="<?php echo (($i%2)==0) ? "gray" : "green"?>">
<td><?php echo (($i%2)==0) ? "gray" : "green"?></td>
</tr>
<?php endfor;?>
</tbody>
</table>
</body>
</html>