码迷,mamicode.com
首页 > 其他好文 > 详细

九九乘法表

时间:2017-06-29 22:33:20      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:margin   inner   lock   pre   pos   12px   charset   padding   str   

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body,div,ul,li{
margin:0;
padding: 0;
font-family: Arial;
font-size:12px;
}
ul li{
list-style:none;
}
#tab{
position:absolute;
top:50%;
left:50%;
padding:10px;
margin-left:-460px;
margin-top:-145px;
width:900px;
height:270px;
border:1px solid red;
border-radius:10px;
}
#tab li{
height:30px;
line-height: 30px;

}
#tab li span{
width:100px;
height:30px;
text-align:center;
display: inline-block;
}
</style>
</head>
<body>
<div id=‘tab‘>
<ul>

</ul>
</div>
<script type=‘text/javascript‘>
var oTab = document.getElementById(‘tab‘);
var str = ‘‘;
str+="<ul>"
for(var i = 1;i<=9;i++){
str+="<li>";
for(var j = 1;j<=i;j++){
str+="<span>";
str+=""+j+"x"+i+" = "+(j*i)+""
str+="</span>"
}
str+="</li>"
}
str+="</ul>"
oTab.innerHTML = str;
</script>
</body>
</html>

九九乘法表

标签:margin   inner   lock   pre   pos   12px   charset   padding   str   

原文地址:http://www.cnblogs.com/likwin/p/7096099.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!