To alternate the color of a row in a table you can do this:
GeSHi (csharp):
for (int i = 0; i < amountOfRows; i++) {
TableRow row =
new TableRow
();
if (i % 2 == 0)
{
row.attributes.add("bgcolor", "#fbcce8");
}
else
{
row.attributes.add("bgcolor", "#fef2f9");
}
}
Created by GeSHI 1.0.7.20