缺c币的都来回答吧,请教各位javascript里怎么打印99乘法表?

缺c币的都来回答吧,请教各位javascript里怎么打印99乘法表?
1*1 = 1
2 * 1 = 1 2*2 = 4
3 * 1 = 1 3 * 2 = 6 3 * 3 = 9
...

0

14个回答

 <!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>九九乘法表</title>
    <style>
        div{
            text-align: center;
            width: 1210px;
            margin: 0 auto;
        }
        table{
            margin: 0 auto;
            border: 4px solid green;
            padding: 5px;
        }
        td{
            border: 1px solid green;
            color: blue;
        }
    </style>
</head>
<body>
<script>
    // 打印9*9乘法表
    document.write("<div>");
    document.write("<h3>"+"九九乘法表"+"</H3>")
    document.write('<table>');//添加table开始标签
    for(var i =1;i<=9;i++){
        document.write('<tr>');//添加tr开始标签
        for(var j=1;j<=i;j++){
            document.write("<td>"+i+"※"+j+"="+i*j+"</td>");//让其在td标签中显示
        }
        document.write("</tr>")//添加tr结束标签
    }
    document.write('</table>');//添加table结束标签
    document.write('</div>');
</script>
</body>
</html>
0
dabocaiqq
dabocaiqq 这个可以,谢谢了。
4 个月之前 回复

public static void main(String[] args) {
for (int i = 1; i <=9; i++) {
for (int j = 1; j <=i; j++) {
System.out.print(j+"*"+i+"="+(i*j)+"\t");
}
System.out.println();
}

}

2
qq_33726373
qq_33726373 <script type="text/javascript"> for (var i = 1; i <= 9; i++) { for (var j = 1; j <= i; j++) document.write(j+"*"+i+"="+j*i+" "); document.write("<br>"); } </script>
4 个月之前 回复
qq_33726373
qq_33726373 <script type="text/javascript"> for (var i = 1; i <= 9; i++) { for (var j = 1; j <= i; j++) document.write(j+"*"+i+"="+j*i+" "); document.write("<br>"); } </script>
4 个月之前 回复
dabocaiqq
dabocaiqq 不行啊
4 个月之前 回复
<script type="text/javascript">
for (var i = 1; i <= 9; i++) {
    for (var j = 1; j <= i; j++)
        document.write(j+"*"+i+"="+j*i+" ");
    document.write("<br>");
}
</script>

2

console界面:
for(var i=1;i<10;i++)
{
var str="";
for(var j=1;j<=i;j++)
{
str+=" "+j+"*"+i+"="+i*j
}
console.log(str)
}

0
var str=''; for (i=1; i<=9;i++) { for(j=1;j<=i;j++) { if (i>j) { str +=j+'*'+i+'='+j*i+' '; } else { str +=i+'*'+j+'='+j*i+' '; } } str+='\n'; } alert(str);
0

var str=''; for (i=1; i<=9;i++) { for(j=1;j<=i;j++) { if (i>j) { str +=j+'*'+i+'='+j*i+' '; } else { str +=i+'*'+j+'='+j*i+' '; } } str+='\n'; } alert(str);

0

<!DOCTYPE html>

//打印99乘法表 for (var n=1;n<=9;n++) { for (var m=1;m<n+1;m++) { var b=m*n; document.write(m+"×"+n+"="+b+" "+" "); } document.write("<br/>"); document.write("<br/>"); }

0

for(var i=1;i<10;i++)
{
var str="";
for(var j=1;j<=i;j++)
{
str+=" "+j+"*"+i+"="+i*j
}
console.log(str)
}

0
var i , j; for(i = 1;i <= 9;i ++){ document.write("<br data-filtered="filtered">"); // i 为行的乘数,j 为列数 每一行打印完后换行 for(j = 1;j <= i;j ++){ sum = i * j; document.write(i ,"*",j ,"=",sum,""); // 使 "i" 和 "j" 能打印出来 } }
0

var i, j; document.write("<tr><td></td>"); for (i=1;i<=9;i++) document.write("<td><b>" + i + "</b></td>"); document.write("<tr>"); for (i=1;i<=9;i++){ document.write("<tr>"); document.write("<td><b>" + i + "</b></td>"); j = 1; while (j <= 9){ document.write("<td>"); document.write(i + "*" + j + "=" + i*j); document.write("</td>"); j++; } document.write("<tr>"); }
0
共14条数据 1 尾页
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!