您的位置:首页 > Web前端 > JavaScript

九九乘法表

2016-07-12 08:21 411 查看
<!DOCTYPE html>
<html>
<head>
<meta
charset="UTF-8">
<title></title>
</head>
<body>
<style
type="text/css">
div{
width:
60px;
height:
20px;
text-align: center;
line-height:
20px;
display:
inline-block;
margin:
4px;
border:
1px solid deeppink;
background-color: deeppink;
color: white;
font-weight:
400;
}
</style>

<script
type="text/javascript">

//九九乘法表
for
(var i = 1; i
<= 9; i++) {
for(var
j = 1; j
< i + 1; j++){
document.write("<div>"
+ j + "*"
+ i + "="
+ (i * j)
+"</div>");
}
document.write("<br />");
}
</script>

</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息