<s:iterator value="itemPageList" status="t">
<tr id="<s:property value='id'/>" bgcolor="<s:property value="%{#t.count%2==0?'#c9cdd2':'#e7eaee'}"/>">
迭代的内容
</tr>
</s:iterator>
下面是另外一种
<s:if test="%{#t.index%2==1}">style="background-color:gray;"</s:if>>
参数说明:
first | 是否是第一个元素 |
last | 是否是最后一个元素 |
index | 取得当前遍历的索引 |
odd | 当前遍历的索引是否为奇数 |
even | 当前遍历的索引是否为偶数 |
count | 已经遍历了多少个记录 |