<c:forEach var="student" items="${ students}" varStatus="status"> <c:if test=”${status.index % 2 == 0}”> <tr class = "even"> --偶数行 ........ </tr> </c:if> <c:if test=”${status.index % 2 == 1}”> <tr class = "odd"> --奇数行 ........ </tr> </c:if> </c:forEach> 然后: 写两个类样式就好了 如: <style type="text/css"> .even { background : white;} .odd { background : blue;} </style>
jsp页面怎么实现隔行变色
最新推荐文章于 2024-04-14 08:44:26 发布