我在类文件中有来自数据库的数据库查询:
List srActionList = hibernate_session.createQuery("from SrActionModal where srReportShow = 'Y' order by actDesc").list();
ArrayList dataResultList = new ArrayList();
SrActionModal status = new SrActionModal();
for (int i = 0; i < srActionList.size(); i++) {
status = (SrActionModal) srActionList.get(i);
status.setActDesc(status.getActDesc());
dataResultList.add(status);
}
session.setAttribute("srActionList", dataResultList);
我想将 srActionList 属性显示到表中。目前我的输出如下所示;
<logic:iterate id="list" name="srActionList">
<html:multibox property="selectedAction">
<bean:write name="list" property='code'/>
</html:multibox>
<bean:write name="list" property='actDesc'/>
</logic:iterate>
我的问题是,如何将结果安排到表格中以便更好地安排?每行的限制列是 2。如果结果大小是 10,那么将有 5 行,每行包含 2 列。
<table>
<tr>
<td>list 1</td> <td>list 2</td>
</tr>
<tr>
<td>list 3</td> <td>list 4</td>
</tr>
</table>