I am using Umbraco 7.x
I need some thing like following In list Item generated using for each. alternating item need to give respective class.
So is their any was to determine even and odd row to give respective class name.
As following is my code for the same.
@foreach (var itemTblRows in @Model.Children)
{
<tr class="light">
<td>@itemTblRows.ABL_tableData1</td>
<td>@itemTblRows.ABL_tableData2</td>
<td>@itemTblRows.ABL_tableData3</td>
<td>@itemTblRows.ABL_tableData4</td>
</tr>
}
I will not like to use CSS and JS to do so, because in other case (with diff. lay out) it will not work.