当前位置: 代码迷 >> Web前端 >> c:forEach 统制列数输出
  详细解决方案

c:forEach 统制列数输出

热度:53   发布时间:2012-11-13 10:00:50.0
c:forEach 控制列数输出
呵呵,list对象在C foreach中可以控制每行多少列输出。
<div style="position:absolute; left:195px; top:165px; border:1px solid #c3daf9; height: 149px; width: 799px;">
<fieldset>
<LEGEND>部门信息</LEGEND>
<table class="formtable">
<c:forEach items="${allDlist}" var="alldept" varStatus="status">
<c:if test="${status.count%5==1}"><tr></c:if>
<td><input type="checkbox" name="" value="${alldept.gid}"></td>
<td><c:out value="${alldept.name}"></c:out></td>
<c:if test="${status.count%5==0}"></tr></c:if>
</c:forEach>
</table>
</fieldset>
</div>