当前位置:网站首页>Create cells through JS (while loop)
Create cells through JS (while loop)
2022-04-23 05:26:00 【Courtesy.】
<script>
function table(options = {
tr: 5, td: 3 }) {
// Create a function , And pass him a parameter options, Set the default initial value
document.write(`<table border="1" width="100%>`);
while (options.tr-- !== 0){
let td = options.td; // Let the cells in each row be the default number of cells and columns
document.write(`<tr>`);
while (options.tr-- !== 0){
document.write(`<td>${
td}</td>`);
}
document.write(`<td>`);
}
document.write(`<table>`);
}
table(); // Call this function You can see the results
//table({ tr: 20, td: 10 }); You can customize the number of rows and columns
</script>
版权声明
本文为[Courtesy.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220544339213.html
边栏推荐
- Three 之 three.js (webgl)旋转属性函数的简单整理,以及基于此实现绕轴旋转的简单案例
- If the route reports an error after deployment according to the framework project
- 改进DevSecOps框架的 5 大关键技术
- Laravel routing job
- Devops life cycle, all you want to know is here!
- To understand Devops, you must read these ten books!
- PIP free export with path (@ file: / / /) notes
- 学习笔记:Unity CustomSRP-10-Point and Spot Shadows
- egg中的cors和proxy(づ ̄3 ̄)づ╭~踩坑填坑的过程~ToT~
- Let the LAN group use the remote device
猜你喜欢
Three 之 three.js (webgl)简单实现根据点绘制线/弧线(基于LineGeometry / Line2 / LineMaterial,绘制两点基于圆心的弧线段)
JSP -- Introduction to JSP
2021-10-08
To understand Devops, you must read these ten books!
Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
Modèle axé sur le domaine DDD (III) - gestion des transactions à l'aide de Saga
Solution of how to log in with mobile phone verification code in wireless network
C#测试调用PaddleSharp模块识别图片文字
双击.jar包无法运行解决方法
mariadb数据库的主从复制
随机推荐
Blender程序化地形制作
The 2021 IT industry project management survey report was released!
The prefix of static of egg can be modified, including boots
Redis的基本知识
Getting started with varnish
npm升级后问题,慌得一批
Top 25 Devops tools in 2021 (Part 2)
何时适合进行自动化测试?(下)
Blender programmed terrain production
Study notes: unity customsrp-11-post processing --- bloom
Asynchronous iterator & asynchronous generator & asynchronous context manager
2021 年 25 大 DevOps 工具(下)
Cloud computing and cloud native architecture design of openshift
Mariadb的半同步复制
如果我是pm之 演出电影vr购票展示
Use pagoda + Xdebug + vscode to debug code remotely
TSlint注释忽略错误和RESTful理解
Data bus realizes the communication between brother components
Low code and no code considerations
Excel 2016 cannot open the file for the first time. Sometimes it is blank and sometimes it is very slow. You have to open it for the second time