JavaScript--练习1--99乘法表

news/2024/7/2 6:47:36

JavaScript--练习1--99乘法表

一、心得

 

二、代码

 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3     <head>
 4         <meta http-equiv="Content-Type" content="text/html; charset=GBK">
 5         <title>Untitled Document</title>
 6         <link rel="stylesheet" href="table.css"/>
 7     </head>
 8     <body>
 9         
10         <script type="text/javascript">
11             /*
12              * 练习:在页面中显示一个99乘法表。
13              * 
14              */
15             document.write("<table>");//html制表
16             for(var x=1; x<=9; x++){
17                 document.write("<tr>");
18                 for(var y=1; y<=x; y++){
19                     document.write("<td>"+y+"*"+x+"="+y*x+"</td>");
20                 }
21                 document.write("</tr>");
22             }
23             document.write("</table>");
24             
25             
26             
27         </script>
28     </body>
29 </html>

table.css中的内容
1 table,table td{
2     border: #0000ff double 1px;
3     width:600px;
4 }

如果不加css的话,没有边线和600px

转载于:https://www.cnblogs.com/Renyi-Fan/p/7060245.html


http://lihuaxi.xjx100.cn/news/241781.html

相关文章

(C++)A+B 输入输出练习V 输入的第一行是一个正数N,表示后面有N行。每一行的第一个数是M,表示本行后面还有M个数。

#include<cstdio>/* 2 4 1 2 3 4 5 1 2 3 4 5 */int main(){int n,a;scanf("%d",&n);while(n--){int sum 0,m;scanf("%d",&m);for(int i 0;i<m;i){scanf("%d",&a);sum a;}printf("%d\n",sum); }return 0;}

spring-boot Junit4单元测试

2019独角兽企业重金招聘Python工程师标准>>> 如果是使用spring-boot 1.4以下的版本 RunWith(SpringJUnit4ClassRunner.class) SpringApplicationConfiguration(classes 启动类.class) public class ApplicationTest {//代码省略 } 使用SpringApplicationConfigurat…

参加软件测试培训需要注意哪些

零基础同学想要学习软件测试&#xff0c;通过自学是比较难的&#xff0c;那么很多人都会考虑软件测试培训机构&#xff0c;那么参加软件测试培训需要注意哪些问题呢?来看看下面的详细介绍。 参加软件测试培训需要注意哪些? 一、科学选择培训机构 要想学到最真实有用的软件测试…

分享一段Java搞笑的代码注释

原文&#xff1a;http://www.cnblogs.com/xdp-gacl/p/4198935.html // _ooOoo_ // o8888888o // 88" . "88 // (| -_- |) // …

(C++)A+B 输入输出练习VI 每行的第一个数N,表示本行后面有N个数。

#include<cstdio>/* 4 1 2 3 4 5 1 2 3 4 5 */int main(){int n;while(scanf("%d",&n) ! EOF){int sum 0,a;for(int i 0;i<n;i){scanf("%d",&a);sum a;}printf("%d\n",sum); }return 0;}

ECLIPSE在线安装SVN

1. 打开eclipse软件&#xff0c;点击菜单栏的help——>Install New Software2. 在弹出来的安装窗口中&#xff0c;点击add按钮&#xff0c;然后输入svn安装地址&#xff1a;http://subclipse.tigris.org/update_1.8.x &#xff0c;点击确定3&#xff0c;勾选要安装的选项&am…

java培训分享:Java程序员职业规划怎么做

参加完java培训的同学&#xff0c;技术学成之后&#xff0c;那么接下来就要做好java的职业规划了&#xff0c;入行前就应该规划好自己的职业发展发展方向。那么Java程序员职业规划怎么做?来看看下面小编的详细介绍吧。 java培训分享&#xff1a;Java程序员职业规划怎么做? 1、…

ubuntu下nginx+php5的部署

ubuntu下nginxphp5环境的部署和centos系统下的部署稍有不同&#xff0c;废话不多说&#xff0c;以下为操作记录&#xff1a;1&#xff09;nginx安装rootubuntutest01-KVM:~# sudo apt-get update && sudo apt-get upgraderootubuntutest01-KVM:~# sudo apt-get install…