在jsp页面中为表格添加各行变色的方法
<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>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
猜你喜欢
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
相关资源
相似解决方案