当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 在table中插入多行,能使用与insertAdjacentHTML相似的功能吗?

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 在table中插入多行,能使用与insertAdjacentHTML相似的功能吗?


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 155 ::
收藏到网摘: n/a

对于div等元素来说,插入一段html是很容易的事情,但是对于表格来说就太难了。一般情况下,我们都是用appendChild的方式,一行行、一格格地添加,操作起来很繁锁。能不能拼一串字符,就能直接加入到表格中呢?
  下面的例子实现了这个功能,同样地,该例支持IE和firefox。该功能的实现意义重大,这样页面元素的处理,就全部都能够用拼html字串的方法来实现了。
点击运行可以看到效果:
[Ctrl+A 全选 提示:你可先修改部分代码,再按运行]