<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Document</title>
<style>
table{
background-color: blue;
}
table td {
background-color: white;
padding: 10px ;
}
</style>
</head>
<body>
<script>
/*
var i = 0 ;
var j = 0 ;
*/
var str = "<table>";
for ( i = 0; i < 10 ; i++){
str += "<tr>";
for (var j = 0; j < 10 ;j++){
str += "<td>" + i + "-" + j +"</td >";
}
str += "</tr>"
}
str += "</table>";
document.write(str);
</script>
</body>
</html>
九九乘法表
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table{
background-color: gray;
}
table td{
background-color: white;
}
</style>
</head>
<body>
<script>
// 九九乘法表
var str = "<table>"
for(var i = 1 ; i <= 9; i++ ){
str += "<tr>";
for (var j = 1 ; j <= i ; j++){
str += "<td>" + i + "x" + j + "=" + i * j + "</td>" ;
}
str += "</tr>";
}
str += "</table>";
document.write (str)
</script>
</body>
</html>