<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
table {
width: 800;
margin: -180px auto;
border-collapse: collapse;
}
td {
width: 80;
height: 30px;
text-indent: 10px;
border: 1px solid #ccc;
color: #666;
}
</style>
<script src="js1.js"></script>
</head>
<body>
</body>
</html>
//js1.js文件内容如下:
document.write('<table>');
for (let i = 1; i < 10; i++) {
document.write('<tr>');
for (let j = 1; j <= i; j++) {
document.write('<td>');
document.write(j + "*" + i + "=" + (i * j));
document.write(" ");
if ((i == 3 && j == 2) || (i == 4 && j == 2)) {
document.write(" ");
}
document.write('</td>');
}
document.write("<br>");
document.write('</tr>');
}
document.write('</table>');
var obj = {
name: 'shangxia',
"age": 23,
fn: function () {
console.log('fn')
}
};
console.log(obj['age']);
obj['fn']();
obj.fn();