table ID="zhutiTable"
html2="<tr></tr>"; 的数据
setTableInnerHTML(document.getElementById('zhutiTable'), html2);
 
function setTableInnerHTML(table, html) {//table 为table对象,html为生成的html字符串
  if (navigator && navigator.userAgent.match(/msie/i)) {
    var temp = table.ownerDocument.createElement('div');
    temp.innerHTML = '<table>' + html + '</table>';//注意此处传进来的html变量包含“<tbody></tbody>”标签  如果HTML变量中没有 则为 '<table><tbody>' + html + '</tbody></table>'
    table.replaceChild(temp.firstChild.firstChild, table.tBodies[0]);//用生成的div中table的tbody替换原table中的tbody
              // table.appendChild(temp.firstChild.firstChild);   //用于添加 tr 到 到已生成好的table 中
  } else {
    table.innerHTML = html;
  }
}
 
 获取 table  中 的tbody   赋值

// var oTBODYData = document.getElementById('zhutiTable').tBodies.item(0);
// oTBODYData.innerHTML+=html2;

发现是在IE6-IE9下,下列元素table,thead,tfoot,tbody,tr,col,colgroup,html,title,style,frameset的innerHTML属性是只读的的更多相关文章

  1. 一句white-space:nowrap解决IE6,IE7下浮动元素不自动换行

    一句white-space:nowrap解决IE6,IE7下浮动元素不自动换行

  2. IE6 7下常见CSS兼容性处理

    以下是一些比较常见的IE6 7下的兼容性问题. 在当下这个时代,其实我们几乎可以不用再去针对IE6做兼容性的处理,除非你的公司还是诡异的要求你兼容到IE6.但是了解一些常见的兼容性问题还是可以帮助我们 ...

  3. IE 中单元格的 colspan 属性在某些情况下会影响 TABLE 元素的自动布局

    今天在写一个jsp页面时,遇到一个如下的问题:在一个table中写了如下内容,table中定义了4列,在firefox中能正常显示,而在ie8中,显示不正常, 如下如图1:第二,三,四列宽度发生变化, ...

  4. 带有 thead、tbody 以及 tfoot 元素的 HTML 表格

    设置样式: <head><style type="text/css">thead {color:green}tbody {color:blue;height ...

  5. IE6下绝对定位元素和浮动元素并列绝对定位元素消失

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  6. IE6下绝对定位元素父级宽高是奇数,绝对定位元素的right和bottom值会有1个像素的偏差

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  7. li里元素都浮动 li 在IE6 7 下方会产生4px间隙问题

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  8. IE6/IE7下margin-bottom失效兼容解决办法及双倍边距问题

    (从已经死了一次又一次终于挂掉的百度空间人工抢救出来的,发表日期 2014-04-08) 一.IE6/IE7下margin-bottom失效兼容解决办法 1.用padding-bottom代替:2.在 ...

  9. WebUploader IE9下报错

    WebUploader是由Baidu WebFE(FEX)团队开发的一个简单的以HTML5为主,FLASH为辅的现代文件上传组件.在项目中,推荐并一直在使用WebUploader进行文件上传业务开发. ...

随机推荐

  1. python-paramiko初体验

    什么pexpect.pxshll在paramiko面前都是浮云,重要的是paramiko支持windows. 小试牛刀 import paramiko paramiko.util.log_to_fil ...

  2. error: &#39;for&#39; loop initial declarations are only allowed in C99 mode

    error: 'for' loop initial declarations are only allowed in C99 mode 使用gcc编译代码是报出 error: 'for' loop i ...

  3. Java课程设计——人事管理系统

    主界面代码: package PersonSystem; import java.awt.*; import java.awt.event.*; import javax.swing.*; impor ...

  4. The Breakpoint will not currently be hit. No executable code associated with this line

    首先.请确认solutin的属性 C/C++->General-> Debug Information Format 选择Program Database(/Zi) Linking-> ...

  5. Codeforces Round #313 A. Currency System in Geraldion(简单题)

    A. Currency System in Geraldion time limit per test 2 seconds memory limit per test 256 megabytes in ...

  6. Android 信息提示——Toast方式

    Toast用于向用户显示一些帮助/提示.一下列举了5中样式. 一.默认的效果(显示在屏幕的底部) 代码: Toast.makeText(getApplicationContext(), "默 ...

  7. Ip获取请求ip

    public class IPAdress { public static bool isIP(string str1) { || str1.Length > ) return false; s ...

  8. 如何的退出无响应的 SSH 连接

    ~. 具体操作是Shift+-,然后松开按.. tips如果无效,可以先按下Enter,然后进行上面的操作.

  9. loj 101 最大流

    冬令营送到我脸上的20分都没拿全 心态爆炸 冬令营前一天学的dinic 后一天才发出来 #include<iostream> #include<cstdio> #include ...

  10. jquery中对于为一组标签赋予点击事件

    可以用each,但是each不能对动态的元素进行事件的绑定, 不过,其实也很简单,只需要获取所有的标签集,然后用动态绑定的方法,比如live进行绑定就可以了. 有时候,其实不难,只是自己想的太过复杂. ...