转载自品略图书馆 http://www.pinlue.com/article/2020/04/2704/2310244117550.html
<div class="table_1">
<table width="100%" border="1" class="different_box">
<!-- <td><label><input name="specialInstall" type="checkbox" class="checkbox" value="上墙" />上墙上墙</label></td> -->
<tr>
<c:forEach items="${specialInstallList}" var="specialInstall" varStatus="status">
<c:if test="${status.count%4!=0}">
<td> ${step}<label><input name="specialInstall" type="checkbox" class="checkbox" value="${specialInstall.id}" />${specialInstall.name}</label></td>
</c:if>
<c:if test="${status.count%4==0}">
<td> ${step}<label><input name="specialInstall" type="checkbox" class="checkbox" value="${specialInstall.id}" />${specialInstall.name}</label></td>
</tr>
<tr>
</c:if>
</c:forEach>
</tr>
</table>
</div>
本文介绍了一种使用JSP和EL表达式在网页上动态生成复选框的方法,根据后端传来的数据列表,可以自适应地调整表格布局,确保每行四个选项,适用于各种需要用户选择特定项的场景。
1730

被折叠的 条评论
为什么被折叠?



