BTW我不擅长造型,这就是为什么我问这个问题:)
JSP:
<c:forEach items="${FieldMap}" var="detFieldEntry">
<fieldset class="det">
<legend>${FieldEntry.key}</legend>
<c:forEach items="${FieldEntry.value}" var="detBean">
<input type="checkbox" name="fieldNames" value="${Bean.fieldName}"
<c:if test="${form.fieldNameMap[Bean.fieldName]}">checked="checked" </c:if>>${Bean.displayName}</input>
</br>
</c:forEach>
</fieldset>
</c:forEach>
的CSS:
table.det
{
}
table.det td
{ border: none; }
fieldset.det
{
display:block;
float:left;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
margin-top:20px;
margin-left:20px;
border:2px solid #CCCCCC;
}
fieldset.det legend
{
padding:2px 5px;
border:2px solid #CCCCCC;
font-weight: bold;
}
答案 0 :(得分:1)
也许是这样的?
print <fieldset>
print <legend>
columns = 2
offset = 0
class = "left"
count = dbResult.length() // Say 9
rows = count / columns // you want to round up to use the next whole int, so 4.5 should be 5.
for i=0, i < columns, i++ {
print <div class="<%=class%>"
for k=0, k < rows, k++ {
print <span><input>k+offset<label></span>
}
offset = rows
print </div>
class = "right"
}
print </fieldset>