不说了,先上效果图,下面附有源码:
代码一:jsp表达式法
<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<center>
<font color="blue" size="80">九九乘法表</font>
</center>
<table border="3">
<%for(int i=1;i<=9;i++){
%>
<tr>
<%for(int j=1;j<=i;j++)
{
%>
<td><%=j %>*<%=i %>=<%=i*j%><% } %>
</td>
</tr>
<% } %>
</table></body>
</html>
2.java输出以及html换行
<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<center>
<font color="blue" size="80">九九乘法表</font>
</center>
<table border="3">
<%for(int i=1;i<=9;i++){
%>
<tr>
<%for(int j=1;j<=i;j++)
{
%>
<td><%out.println(j+"*"+i+"="+i*j+" "); out.println("</br>");%><% } %>
</td>
</tr>
<% } %>
</table></body>
</html>