Hello I am currently iterating and displaying a list of fieldsets in a table. For the sake of trying to make the layout somewhat decent. I want to create a new row every time the loop gets to the 5th fieldSet. Thanks
JSP:
<div class="det" id="displayFields">
<table class="det">
<tr>
<td>
<c:forEach items="${detFieldMap}" var="detFieldEntry">
<fieldset class="det">
<legend>${detFieldEntry.key}</legend>
<c:forEach items="${detFieldEntry.value}" var="detBean">
<input type="checkbox" name="fieldNames" value="${detBean.fieldName}" <c:if test="${preselectionMap[detBean.fieldName]}">checked="checked"</c:if>>${detBean.displayName}</input>
</br>
</c:forEach>
</fieldset>
</c:forEach>
</td>
</tr>
</table>
</div>
This worked:
<div class="det" id="displayFields">
<table class="det">
<tr>
<td>
<c:forEach items="${detFieldMap}" var="detFieldEntry" varStatus="loop">
<c:if test="${not loop.first and loop.index % 5 == 0}">
</td>
</tr>
<tr>
<td>
</c:if>
<fieldset class="det">
<legend>${detFieldEntry.key}</legend>
<c:forEach items="${detFieldEntry.value}" var="detBean">
<input type="checkbox" name="fieldNames" value="${detBean.fieldName}" <c:if test="${preselectionMap[detBean.fieldName]}">checked="checked"</c:if>>${detBean.displayName}</input>
</br>
</c:forEach>
</fieldset>
</c:forEach>
</td>
</tr>
</table>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With