I am trying this but its going to else part always
<c:forEach items="${records}" var="field" varStatus="counter">
<c:choose>
<c:when test="${counter.count mod 2 == 0}">
<div class="classEven">
</c:when>
<c:otherwise>
<div class="classOdd">
</c:otherwise>
</c:choose>
sample text here
</div>
</c:forEach>
What's wrong with this?
You could also use ${counter.count % 2 == 0}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With