使用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>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章