形式例如
A B C D
E F G H
I J K
用标签动态输出
A B C D
E F G H
I J K
用标签动态输出
// 设置数据长度数
<c:set var="size" value="${vacancyForm.length}"/>
<table width="100%" height="200" border="0" cellpadding="0" cellspacing="0">
// 循环数据"ids",varStatus 记录索引等
<c:forEach items="${vacancyForm.ids}" var="a" varStatus="status">
// 如果是第一个数据,打印头一行开头
<c:if test="${0 == status.index}">
<tr id="leaseDiv" style="display:inline;">
</c:if>
// 打印每一列数据
<td >${a} </td>
// 每行显示4个数据,如果是4的倍数而且不是第一条数据,打印换行与下一行开头
<c:if test="${0 == (status.index+1) %4 and !status.last and !status.first}">
</tr><tr id="leaseDiv" style="display:inline;">
</c:if>
// 如果是最后一条数据 ,打印结束行符
<c:if test="${status.last}">
</tr>
</c:if>
</c:forEach>
</table>