Tabliczka mnożenia (1)

Kod HTML do analizy

<!DOCTYPE html>
<html lang='pl-PL'>
<head>
  <meta charset='utf-8'>
  <title>Tabliczka mnożenia</title>
  <link rel="stylesheet" href='style.css'>
</head>
<body>
  <h1>Tabliczka mnożenia (1)</h1>
  <table>
    <script src="tm.js"></script>
  </table>
</body>
</html>

JavaScript – plik: tm.js

document.write("<tr>");
document.write("<th>&times;</th>");

for(j = 1; j < 10; j++){
  document.write("<th>", j,"</th>");  
}
document.write("</tr>");

for(i = 1; i < 10; i++){
  document.write("<tr>");
  document.write("<th>", i, "</th>");
  for(j = 1; j < 10; j++){
    document.write("<td>", i * j, "</td>");
  }
  document.write("</tr>");
}
body {
  font-family: verdana;
  font-size: 1.5em;
}
table {
  border: solid 1px red;
  border-collapse: collapse;
  margin: 0 auto;
}
h1 {
  text-align: center;
}
td { 
  color: blue; 
  border: 1px solid red;  
  padding: 2px;
  width: 40px;
  text-align: right;
}
th { 
  color: red;
  background-color: yellow;
  border: 1px solid red;  
  padding: 2px;
  width: 40px;
}