对表格的动态添删改填充谁能写一套 完整,最好是经过测试的! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 具体的情况千差万别,在此仅提供一个思路:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title><script src="http://code.jquery.com/jquery-latest.js"></script><style> table{border:solid 1px red;} td{width:200px;height:20px;border:solid 1px black}</style><script>$(function(){ $('#Button1').click(function(){ $('#temp_tab tr:first').clone(true).appendTo('#temp_tab') }) $('#Button2').click(function(){ $('#temp_tab tr').prepend('<td></td>') }) $('#temp_tab button').click(function(){ $(this).parents('tr').remove() }) $('#Button3').click(function(){ $('#temp_tab tr').each(function(){ $(this).children('td:first').remove() }) }) })</script></head><body><table id="temp_tab"><tr><td></td><td><button>删除行</button></td></tr></table><button id="Button1">添加行"</button><button id="Button2">添加列"</button><button id="Button3">删除列"</button></body></html> http://download.csdn.net/detail/woshilifeng130/3547132到csdn下载上边下吧 这个只需要1个下载分 没有的话 用5个可用分去兑换一下 <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> Label在firefox里面为什么不能响应click事件呢? JQuery乱码问题 JS怎样转换yyyy-mm-dd成yyyy-mm-dd hh:mm:ss 这样的格式? 请教有关页面定位的问题 javascript 选择日期控件 如何SCRIPT 元素加载的内容,求助! radiogroup的问题 如何禁用网页上按backspace键会回退到上一个页面?? javascript判断操作系统 怎样检测连接有效还是无效,然后自动定位?????? 鼠标点击过快时,效果冲突 如何判断store中的某列为空时 不能提交form?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title><script src="http://code.jquery.com/jquery-latest.js"></script>
<style>
table{border:solid 1px red;}
td{width:200px;height:20px;border:solid 1px black}
</style>
<script>
$(function(){
$('#Button1').click(function(){
$('#temp_tab tr:first').clone(true).appendTo('#temp_tab')
})
$('#Button2').click(function(){
$('#temp_tab tr').prepend('<td></td>')
})
$('#temp_tab button').click(function(){
$(this).parents('tr').remove()
})
$('#Button3').click(function(){
$('#temp_tab tr').each(function(){
$(this).children('td:first').remove()
})
})
})
</script></head><body>
<table id="temp_tab"><tr><td></td><td><button>删除行</button></td></tr></table>
<button id="Button1">添加行"</button>
<button id="Button2">添加列"</button>
<button id="Button3">删除列"</button></body>
</html>
到csdn下载上边下吧 这个只需要1个下载分 没有的话 用5个可用分去兑换一下
<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>