<table id="vegetableTable" width="100%" height="96%">
<tr>
<c:forEach var="foods" items="${foodMap}" varStatus="stat">
<td width="22%">
<fieldset style="border:1px solid #AED0EA;margin:2px 2px 0px 2px;">
<legend>${foods.key}</legend>
<div class="typeDiv">
<table width="100%" >
<c:forEach items="${foods.value}" var="entity">
<tr>
<td class="right" align="right">
${entity.name}(${entity.quantity})
</td>
<td class="left" align="left">
<input class="ui-widget ui-widget-header ui-corner-all" name="decreaseBtn" type="button" value="-" />
<input type="text" name="caipin" style="width:16px;" value="0" id="10" category="1" />
<input class="ui-widget ui-widget-header ui-corner-all" name="increaseBtn" type="button" value="+" kucun="${entity.quantity}" />
</td>
</tr>
</c:forEach>
</table>
</div>
</fieldset>
</td>
<!-- 不够四列的行用空列补齐 -->
<c:if test="${stat.last && stat.count%4 != 0}">
<c:set value="${4-(stat.count%4)}" var="restTd"/>
<c:forEach var="x" begin="1" end="${restTd}" step="1">
<td width="22%"></td>
</c:forEach>
</c:if>
<!-- 4列换一行 -->
<c:if test="${stat.count%4==0}">
</tr><tr>
</c:if>
</c:forEach>
</tr>
</table>
JSTL控制表格换行
最新推荐文章于 2021-03-04 13:42:34 发布