99 multiplication table to use for recycling, many companies in the Central Standing Committee of the interview the interviewer handwriting algorithm requires, be regarded as more classic applications for loop
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>99乘法表</title>
</head>
<script type="text/javascript">
document.write("<table border='1px'>");
//循环行
for (var i = 1; i <= 9; i++){
document.write("<tr>");
//循环列
for (var j = 1; j <= i; j++){
document.write("<td>");
document.write(j + "*" + i +"="+ i*j +" ");
document.write("</td>");
}
//document.write("</br>");
document.write("<tr>");
}
document.write("</table>");
</script>
<body>
</body>
</html>
running result: