使用c:foreach控制个数进行换行

下述代码是控制5个进行换行:

<table  >
	<c:forEach items="${nodeList}" var="node" varStatus="status">
      <c:if test="${status.count eq 1 || (status.count-1) % 5 eq 0}">
		<tr>
	  </c:if>
		<td>
		 <input type="checkbox" name="requirementNodeIdArray" value="${node.id }"> 
         ${node.nodeName } 
		</td>
	  <c:if test="${status.count % 5 eq 0 || status.count eq 5}">
		</tr>
	  </c:if>
	</c:forEach>
</table>

猜你喜欢

转载自blog.csdn.net/xuhaogang3/article/details/84026649