99乘法法则(使用bootstrap做表格效果)

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

</head>
<body>
<script>

var htmlStr = '<table class="table table-bordered"> ';//使用bootstrap
for (var i = 1; i <= 9; i++){
htmlStr += '<tr>';
for (j = 1; j <= i; j++){
htmlStr += '<td>' + j + '*' +i + '=' + (i * j) + '</td>';
}
htmlStr += '</tr>';
}
htmlStr += '</table>';
document.write(htmlStr);
</script>
</body>
</html>

网页中效果:


 


 

posted on 2017-04-12 21:45  chuangzi  阅读(606)  评论(0编辑  收藏  举报

导航