If you could consider the alternating colours a progressive enhancement and not absolutely required in all (old) browsers then you could use a CSS n-th child selector to apply the colour without changing the HTML.
If you have jQuery (or similar) in your project already and want a solution for older browser, you could use that to select every other row with the :odd or :even selector.
Update (Example)
Assuming we are using table rows
tr:nth-child(odd) td{
background-color: red;
}
You can also use even
, 2n
or 2n+1
. This would work equally well with
<li>
tags.
More examples:
http://reference.sitepoint.com/css/pseudoclass-nthchild