正直角
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
for(var i=1;i<=9;i++){
for(var j=1;j<=i;j++){
document.write(j+"*"+i+"="+(i*j));
document.write(" ");
}
document.write("<br>");
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div style="width:550px;text-align:right">
<script>
for(var i=1;i<=9;i++){
for(var j=1;j<=i;j++){
document.write(j+"*"+i+"="+(i*j));
document.write(" ");
}
document.write("<br>");
}
</script>
</div>
</body>
</html>
倒直角
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
for(var i = 9;i>=1;i--){
for(var j = 1;j<=i;j++){
document.write(j+"*"+i+"="+(i*j));
document.write("  ");
}
document.write("<br>")
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div style="width:550px;text-align:right">
<script>
for(var i=9;i>=1;i--){
for(var j=1;j<=i;j++){
document.write(j+"*"+i+"="+(i*j));
document.write(" ");
}
document.write("<br>");
}
</script>
</div>
</body>
</html>
等边三角
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
for(var i=1;i<=9;i++){
for(var c=1;c<=9+1-i;c++){
document.write(" ")
}
for(var j=1;j<=i;j++){
document.write(j+"*"+i+"="+(i*j));
document.write(" ");
}
document.write("<br>");
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
for(var i=9;i>=1;i--){
for(var c=1;c<=9+1-i;c++){
document.write(" ")
}
for(var j=1;j<=i;j++){
document.write(j+"*"+i+"="+(i*j));
document.write(" ");
}
document.write("<br>");
}
</script>
</body>
</html>