Code to alternate background colors in table rows.
<style type="text/css">
.odd {
background: #ddd;
}
</style>
<table>
[* foreach $num (1 .. 10){ *]
[$ if ($num % 2) $]
<tr><td class="odd">[+ $num +] is odd</td></tr>
[$ else $]
<tr><td class="even">[+ $num +] is even</td></tr>
[$ endif $]
[* } *][# endforeach #]
</table>