java_web/webapp/square.jsp

39 lines
855 B
Plaintext
Raw Permalink Normal View History

2024-11-25 19:06:50 +08:00
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Number Squares</title>
<style>
table {
border-collapse: collapse;
margin: 20px;
}
th, td {
border: 1px solid black;
padding: 8px;
text-align: center;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<table>
<tr>
<th>数字</th>
<% for(int i = 0; i < 10; i++) { %>
<td><%= i %></td>
<% } %>
</tr>
<tr>
<th>平方值</th>
<% for(int i = 0; i < 10; i++) { %>
<td><%= i * i %></td>
<% } %>
</tr>
</table>
</body>
</html>