普通方法也可以阿,页面中使用如下代码:
...
<%
int i = 0;
String col = "";
while (rs.next()) {
    if (i % 4 == 0) { col = rs.getString(1);
%>
    <tr><td><%=col%></td>
<%
    } else if (i % 3 == 0) { col = rs.getString(1);
%>
    <td><%=col%></td></tr>
<%
    } else { col = rs.getString(1);
%>
    <td><%=col%></td>
<%
    }
    i ++;
}
%>
...