简易九九乘法表
2016-09-26 21:12
183 查看
实现一:
<%@ page language="java" import="java.util.*,java.text.*"
contentType= "text/html; charset=utf-8" %>
<html>
<head>
<title>九九乘法表</title>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<table border="1">
<caption>乘法口诀表</caption>
<tbody>
<%
for(int i=1;i<=9;i++){
%>
<tr>
<%
for(int j=1;j<=i;j++){
%>
<td>
<%= j%>*<%=i %>=<%=j*i %>
</td>
<%} %>
</tr>
<%}%>
</tbody>
</table>
</body>
</html>
实现二:
<%@ page contentType="text/html;charset=utf-8"%>
<html>
<head>
<title>九九乘法表</title>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<table border="1">
<caption>乘法口诀表</caption>
<tbody>
<%
for(int i = 1; i <= 9; i++) {
out.print("<tr>");
for(int j = 1;j <= i; j++) {
out.print("<td>" + j + "*" + i + "=" + j*i + "</td>");
}
out.print("</tr>");
}
%>
</tbody>
</table>
</body>
</html>
index.css
body {
padding:0;margin: 0;
}
table{
width: 810px;
height: 500px;
margin:auto;
border-collapse: collapse;
border: none;
text-align: center;
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
background-color:#000;
}
caption {
font-size: 2rem;
line-height: 50px;
color: rgb(232,237,81);
}
table tr {
height: 50px;
}
table td {
width: 90px;
height: 50px;
background-color: rgb(184,247,136);
}
table td:hover {
background-color: rgba(255,0,0,.6);
}
<%@ page language="java" import="java.util.*,java.text.*"
contentType= "text/html; charset=utf-8" %>
<html>
<head>
<title>九九乘法表</title>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<table border="1">
<caption>乘法口诀表</caption>
<tbody>
<%
for(int i=1;i<=9;i++){
%>
<tr>
<%
for(int j=1;j<=i;j++){
%>
<td>
<%= j%>*<%=i %>=<%=j*i %>
</td>
<%} %>
</tr>
<%}%>
</tbody>
</table>
</body>
</html>
实现二:
<%@ page contentType="text/html;charset=utf-8"%>
<html>
<head>
<title>九九乘法表</title>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<table border="1">
<caption>乘法口诀表</caption>
<tbody>
<%
for(int i = 1; i <= 9; i++) {
out.print("<tr>");
for(int j = 1;j <= i; j++) {
out.print("<td>" + j + "*" + i + "=" + j*i + "</td>");
}
out.print("</tr>");
}
%>
</tbody>
</table>
</body>
</html>
index.css
body {
padding:0;margin: 0;
}
table{
width: 810px;
height: 500px;
margin:auto;
border-collapse: collapse;
border: none;
text-align: center;
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
background-color:#000;
}
caption {
font-size: 2rem;
line-height: 50px;
color: rgb(232,237,81);
}
table tr {
height: 50px;
}
table td {
width: 90px;
height: 50px;
background-color: rgb(184,247,136);
}
table td:hover {
background-color: rgba(255,0,0,.6);
}
相关文章推荐
- Homework- 九九乘法表、简易的电梯实现
- 14-简易的时钟
- 简易基础版单页面应用
- Raphael.js简易教程
- 简易递归快排 QuicklySort C++
- Android简易实战教程--第九话《短信备份~二》
- Python实现简易版的Web服务器(推荐)
- 简易年历
- Android简易实战教程--第十话《模仿腾讯手机助手小火箭发射详解》
- X-简易版之最短距离
- 编写简易的JS输入框模糊查询匹配(附有源码和demo)
- Android之简易天气预报小应用(xml解析练手)
- Express+mongoose搭建简易的web数据接口
- 如何用JS写九九乘法表
- Android简易实战教程--第十一话《获取手机所有应用信息Engine类详解》
- Entity Frame Code First 简易教程
- OstrichNet 简易统计信息收集工具
- js实现九九乘法表
- PHP倒序九九乘法表
- unicode gb2312 utf-8 ucs-2相关(简易版)