<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>for二重循环输出一个3行5列的table</title> </head> <body> <%-- for二重循环输出一个3行5列的table --%> <table border="1"> <% for(int i=1;i <= 3;i++){ out.println("<tr></tr>");%> <%for(int j=1;j<= 5;j++){ out.print("<td>"+j+"</td>"); } } %> </table> </body> </html>