<table>
<c:forEach var="person" items="${people.people}" varStatus="rowCounter">
<c:choose>
<c:when test="${rowCounter.count % 2 == 0}">
<c:set var="rowStyle" scope="page" value="odd"/>
</c:when>
<c:otherwise>
<c:set var="rowStyle" scope="page" value="even"/>
</c:otherwise>
</c:choose>
<tr class="ÃÂ${rowStyle}">
<td>${person.name}</td>
<td>${person.age}</td>
<td>${person.height}</td>
</tr>
</c:forEach>
</table>
Detail, please refer: crazysquirrel.com
Nota:
Tutorial ini tunjukkan bagaimana untuk gunakan varStatus dan property count yang telah disediakan.
No comments:
Post a Comment