请教如何用javascript来实现99乘法表啊,我处理不好换行,请指点,在线等待啊

ght18 2004-10-24 09:54:31
我的代码如下:
<html>
<head>
<title>九九乘法表</title>
</head>
<body>
<%
dim a,b
for a=1 to 9
for b=1 to 9
response.write a&"*"&b&"="&a*b&"<br>"
next
next
%>
</body>
</html>
...全文
273 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ght18 2004-10-24
  • 打赏
  • 举报
回复
谢谢帮助了
多菜鸟 2004-10-24
  • 打赏
  • 举报
回复
<script language="javascript">
var table = "<table border=1>";
for(i = 1; i <= 9; i++){
table += "<tr>\n";
for(j = 1; j <= i; j++){
table += "<td>"+j+" X "+i+" = "+(i*j)+"</td>\n";
}
table += "</tr>\n";
}
table += "</table>";
document.write(table);
</script>
Drowning 2004-10-24
  • 打赏
  • 举报
回复
<script>
function pop()
{
var str
var a=window.open("about:blank","aa","left=200,top=160,width=580,height=340");
str="<p align=center><b>乘法口诀表</b></p>\n"
str+="<table width=100% border=1>\n"
for(i=1;i<10;i++)
{
str+="<tr>\n"
for(j=1;j<=i;j++)
{
str+="<td>"+j+"*"+i+"="+i*j
str+="</td>\n"
}
str+"</tr>\n"
}
str+="</table>\n"
str+="<p align=center><input type=button value='关 闭' onclick='javascript:window.close()'></p>"
a.document.write(str);
}
</script>
<input type=button name=btn2 value="乘法口诀" onclick="pop()">
ght18 2004-10-24
  • 打赏
  • 举报
回复
<% dim a,b
for a=1 to 9
for b=1 to 9
response.write a&"*"&b&"="&a*b&"<br>"
next
next
%> 现在要求输出是三角型的,我用asp写的不对,请叫高手用javascript来帮忙实现,谢谢了
ght18 2004-10-24
  • 打赏
  • 举报
回复
<html>
<head>
<title>九九乘法表</title>
</head>
<body>
<%
dim a,b
for a=1 to 9
for b=1 to 9
response.write a&"*"&b&"="&a*b&"<br>"
next
next
%>
</body>
</html>

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧