换行显示

list传值,每4列换行显示,代码如下:
<div id="orgsDiv">
	<c:set var="j" value="0" />
	<c:set var="type" value="" />
	<c:forEach items="${orgs}" var="org" varStatus="i">
		<c:if test="${type != org.type && i.index!=0}">
                // forEach 补列
			<c:forEach begin="${j%4}" end="3">  
				<td width="25%"> </td>
			</c:forEach>
			</tr>
			</table>
			<hr width="100%" style="border: 1px solid #cadae8; height: 1px">
		</c:if>
		<c:if test="${type != org.type }">
			<c:set var="j" value="0" />
			<table border="0" width="100%" cellpadding="0" cellspacing="0">
		</c:if>
		<c:if test="${j%4 == 0}">
			<tr>
		</c:if>
		<td width="25%">
			<html:multibox property="orgIds">${org.id}</html:multibox>
			<c:out value="${org.shortName}" />
		</td>
		<c:if test="${(i.last) || (j%4 == 3)}">
			<c:if test="${i.last}">
				<c:forEach begin="${i.index%4}" end="2">
					<td width="25%"> </td>
				</c:forEach>
			</c:if>
			</tr>
			<c:if test="${i.last}">							
				</table>
			</c:if>	
		</c:if>
		<c:set var="j" value="${j+1}" />
		<c:set var="type" value="${org.type}" />
	</c:forEach>
</div>
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值