如何把数据库里面的表显示到网页表格中
数据库里面表格,应该是属于2维数组吧?ArrayList<String[]> users=(ArrayList<String[]>)request.getAttribute("users");
for (String[] stu : users){
out.println("<tr>");
out.print("<td>"+" "+stu[1]+"</td>");
out.print("<td>"+" "+stu[2]+"</td>");
out.print("<td>"+" "+stu[3]+"</td>");
out.print("<td>"+" "+stu[4]+"</td>");
out.print("<td>"+" "+stu[5]+"</td>");
out.print("<td>"+" "+stu[6]+"</td>");
out.print("<td>"+" "+stu[7]+"</td>");
out.println("</tr>");
} --------------------编程问答-------------------- ArrayList<String[]> users=(ArrayList<String[]>)request.getAttribute("users");
out.println("<table>");
for (String[] stu : users){
out.println("<tr>");
out.print("<td>"+" "+stu[1]+"</td>");
out.print("<td>"+" "+stu[2]+"</td>");
out.print("<td>"+" "+stu[3]+"</td>");
out.print("<td>"+" "+stu[4]+"</td>");
out.print("<td>"+" "+stu[5]+"</td>");
out.print("<td>"+" "+stu[6]+"</td>");
out.print("<td>"+" "+stu[7]+"</td>");
out.println("</tr>");
}
out.println("</table>");
补充:Java , Web 开发