- var mytable = document.getElementById("propertyTable");
- var row = mytable.insertRow();
var mytable = document.getElementById("propertyTable");
var row = mytable.insertRow();
方法一:设置css class方式,如下,“table01-td01"为一css class样式
- var mytd= row.insertCell();
- mytd.className="table01-td01";
var mytd= row.insertCell();
mytd.className="table01-td01";
方法二:直接设置style属性,如下
- row .style.backgroundColor="#FFFFFF" ;
-
-
- td=row .insertCell();
- td.style.cssText="BORDER-BOTTOM: #4a75ce 1px solid";
-
-
- td.innerHTML="<input name=button type=button />";
-
来源:
http://lzc0088.javaeye.com/blog/494109