利用java程序片,用for二重循环输出一个3行5列的table
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> </head> <body> <% out.print("<table>"); for (int i = 1; i <= 3; i++) { out.print("<tr></tr>"); for (int j = 1; j <= 5; j++) { out.print(" <td> " + j + "</td>"); } } out.print("</table>"); %> </body> </html>