今天要做一个动态的页面,一行3个控件动态生成,然后多余的自动换行。
在网上找了一个代码,感觉很好,以它为参照。
<tr>
<div id="xlxka">
<table bgcolor="red" width="100%">
<bean:size name="list_zdy" id="count"/>
<c:forEach var="one" items="${list_zdy}" varStatus="cou">
<!-- begin -->
<c:if test="${cou.count eq 1 || (cou.count-1) % 3 eq 0}">
<tr>
</c:if>
<td>
<table width="33%">
<tr>
<td width="100%" height=25>
${one.mc}
</td>
</tr>
</table>
</td>
<c:if test="${cou.count % 3 eq 0 || cou.count eq 3}">
</tr>
</c:if>
<!-- end -->
</c:forEach>
</table>
</div>
</tr>
</table>
</body>