52,797
社区成员
发帖
与我相关
我的任务
分享
<script>
function rdl_doAdd(){
var oBody=document.createElement("<tbody id=myBody>");
document.all("myTable").insertBefore(oBody, docuemnt.getElementById("myFoot"));
for (m=0;m<3;m++) {
var myTR =oBody.insertRow();
for (i=0;i<4;i++) {
var myTD=myTR.insertCell();
myTD.innerText="第"+(i+1).toString()+"个单元格";
}
}
docuemnt.getElementById("myHeadTD").colSpan=docuemnt.getElementById("myFootTD").colSpan=i.toString();
window.resizeTo(320,310);
}
</script>
<table cellspacing=1 id=myTable width=90%>
<thead id=myHead><tr><td id=myHeadTD>这是标题</td></tr></thead>
<tfoot id=myFoot><tr><td id=myFootTD>这是脚注</td></tr></tfoot>
</table>
<br><input type=button value=" 插入TBODY " onclick="rdl_doAdd();">
<script language="javascript">
function Change(n)
{
if(n ==0)
{
document.all.main.innerHTML = "<tr><td bgcolor='#000000'><img src='images/Spacer.gif' width='1' height='1'></td></tr><tr><td><div align='right'>fff</div></td> </tr>";
}
}
</script>
<img src="file:///E ¦/my web/images/xianliao.gif" name="Image1" width="98" height="40" border="0" id="Image1" onclick="Change(0)" />
``````
<table width="176" height="112" border="1" id="main" name="main"> <tr>
</table>