话不多说,我们直接上代码:
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2020/4/21
Time: 14:20
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>九九乘法口诀表</title>
<style type="text/css">
table{
width: 650px;
}
</style>
</head>
<body>
<h1 align="center">九九乘法口诀表</h1>
<table align="center">
<%for (int i = 1; i <= 9; i++) { %>
<tr>
<%for (int j = 1; j <= i; j++) {%>
<td>
<%=j + "x" + i + "=" + (i * j)%>
</td>
<% } %>
</tr>
<% } %>
</table>
</body>
</html>
效果截图: