<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
var sum = 0;
for (i = 1; i <= 9; i++) {
for (j = 1; j <= i; j++){
sum = i * j;
document.write(i + "x" + j + "=" + sum + " " + " ");
}
document.write("<br/>");
}
</script>
</head>
<body>
</body>
</html>
运行截图