<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<style>
div {
display: inline-block;
padding: 0 20px 30px 20px;
margin: 15px;
border: 1px solid gray;
line-height: 2;
}
div h3 {
text-align: center;
font-weight: bold;
}
</style>
<h1>구구단</h1>
<script>
for(let i = 2; i <= 9; i++) {
document.write("<div>");
document.write("<h3>" + i + "단</h3>");
for(let j = 2; j <= 9; j++) {
document.write(`${i} x ${j} = ${i * j} <br>`)
}
document.write("</div>")
}
</script>
</body>
</html>