那里有动态table生成的代码?要求能动态的添加一行和删除一行? 当然可以,生成一行就是增加一对<tr></tr>用动态语言设定循环,删除也是一样式 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <HTML><SCRIPT LANGUAGE="JScript">function numberCells() {var count=0;for (i=0; i < document.all.mytable.rows.length; i++){for (j=0; j < document.all.mytable.rows(i).cells.length; j++) {document.all.mytable.rows(i).cells(j).innerText = count;count++;}}}function tb_addnew(){var ls_t=document.all("mytable")maxcell=ls_t.rows(0).cells.length;mynewrow = ls_t.insertRow();for(i=0;i<maxcell;i++){mynewcell=mynewrow.insertCell();mynewcell.innerText="a"+i;}}function tb_delete(){var ls_t=document.all("mytable");ls_t.deleteRow() ;}</SCRIPT><BODY onload="numberCells()"><TABLE id=mytable border=1><TR><TH> </TH><TH> </TH><TH> </TH><TH> </TH></TR><TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR><TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR></TABLE><input type=button value="新增" onclick="tb_addnew()"><input type=button value="删除" onclick="tb_delete()" ></BODY></HTML> 像老况weidegong(weidegong)的script是用什么脚本编辑器来写才能方便找到操作table的insertRow,deleteRow,insertCell等那些方法。我的目的是来知道更多有关对table操作的方法及属性,并找到一个更好的脚本编辑器。 这个啊,我也没有听过类似的编辑器,自己去查javascript的手册呗孟子E章也许会有? http://www.csdn.net/Expert/topic/480/480450.shtm <SCRIPT LANGUAGE="JScript">function numberCells(){ var count=0; for (i=0; i < document.all.mytable.rows.length; i++) { for (j=0; j < document.all.mytable.rows(i).cells.length; j++) { document.all.mytable.rows(i).cells(j).innerText = count; count++; } }}</SCRIPT> DIV样式调节 请问如何在一个网页中实现玫瑰花缓缓落下的效果? JS读取XML问题.急//在线等. 高手指教:javaScript 如何定位到指定的作用区域 求一段控制左边框架的收缩代码 js取得绝对路径 简单问题,请JS高手帮忙!谢谢! 怎樣讓層能夠用鼠標拖動起來﹗?不用DW里的方法﹗﹗ <iframe>里的src(即调用的)页面怎样控制其上级页面的对象?谢了!分不多了,搞定再加! 有关window.open()及window.print()的问题? jscript怎样统计一个子串出现的次数呢 这段代码为什么是不会执行将所有的checkbox都设置为选择状态。盘高手。
<SCRIPT LANGUAGE="JScript">
function numberCells()
{
var count=0;
for (i=0; i < document.all.mytable.rows.length; i++)
{
for (j=0; j < document.all.mytable.rows(i).cells.length; j++)
{
document.all.mytable.rows(i).cells(j).innerText = count;
count++;
}
}
}function tb_addnew()
{
var ls_t=document.all("mytable")
maxcell=ls_t.rows(0).cells.length;
mynewrow = ls_t.insertRow();
for(i=0;i<maxcell;i++)
{
mynewcell=mynewrow.insertCell();
mynewcell.innerText="a"+i;}
}function tb_delete()
{
var ls_t=document.all("mytable");ls_t.deleteRow() ;
}</SCRIPT>
<BODY onload="numberCells()">
<TABLE id=mytable border=1>
<TR><TH> </TH><TH> </TH><TH> </TH><TH> </TH></TR>
<TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR>
<TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR>
</TABLE>
<input type=button value="新增" onclick="tb_addnew()">
<input type=button value="删除" onclick="tb_delete()" >
</BODY>
</HTML>
function numberCells()
{
var count=0;
for (i=0; i < document.all.mytable.rows.length; i++)
{
for (j=0; j < document.all.mytable.rows(i).cells.length; j++)
{
document.all.mytable.rows(i).cells(j).innerText = count;
count++;
}
}
}
</SCRIPT>