利用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>

 

 

posted on 2021-03-10 18:11  Lilbetter  阅读(63)  评论(0编辑  收藏  举报