怎样做当前行有数据时自动添加一空白行 <table> <tr> <td><input type="text" name="id"></td> <td><input type="text" name="name"></td> </tr></table> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <table> <tr> <td> <input type= "text " name= "id "> </td> <td> <input type= "text " name= "name "> </td> </tr> </table> 就是上面的行输入数据时,自动添加一空行待输入 用JS的insertRow和insertCell方法添加行和列,用createTextNode添加文本框,用appendChild方法把文本框添加入列 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>增加Table行</title> </head> <script> function addRow(obj) { //添加一行 var newTr = testTbl.insertRow(); //添加两列 var newTd0 = newTr.insertCell(); var newTd1 = newTr.insertCell(); //设置列内容和属性 newTd0.innerHTML = '<input type=checkbox id="box4">'; newTd1.innerText= '新加行'; } </script> <body> <table id="testTbl" border=1> <tr id="tr1"> <td ><input type=checkbox id="box1"></td> <td id="b">第一行</td> </tr> <tr id="tr2"> <td ><input type=checkbox id="box2"></td> <td id="b">第二行</td> </tr> <tr id="tr3"> <td ><input type=checkbox id="box3"></td> <td>第三行</td> </tr> </table> <br /> <input type="button" id="add" onclick="addRow();" value="Add Row" /> </body></html>一段简单的代码 自己修改下 简直是灵异事件,大家帮忙分析下原因 急 关于PHP扩展 PHP页面刷新会变空白 请问 js配合php怎样把js修改后的临时html保存到新html文件? ajax刷新后,怎么给用户提示 php文件接收不到post返回值 PHP函数可选参数? 问一个 function 中 if 语句的问题,本人菜鸟一个 求:寻求PHP计数统计系统(强劲的) 我是新手,请教各位一个问题 用户通过我提供的用户名和口令登录到我的聊天室后,该用户退出时我如何判断他已经退出了?? 请虚心请教一个关于 PHP读取XML的问题,我死活就读不出来 怎样把JS代码改成面向对象的JS
<tr>
<td> <input type= "text " name= "id "> </td>
<td> <input type= "text " name= "name "> </td>
</tr>
</table>
就是上面的行输入数据时,自动添加一空行待输入
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>增加Table行</title>
</head>
<script>
function addRow(obj)
{
//添加一行
var newTr = testTbl.insertRow();
//添加两列
var newTd0 = newTr.insertCell();
var newTd1 = newTr.insertCell();
//设置列内容和属性
newTd0.innerHTML = '<input type=checkbox id="box4">';
newTd1.innerText= '新加行';
}
</script>
<body>
<table id="testTbl" border=1>
<tr id="tr1">
<td ><input type=checkbox id="box1"></td>
<td id="b">第一行</td>
</tr>
<tr id="tr2">
<td ><input type=checkbox id="box2"></td>
<td id="b">第二行</td>
</tr>
<tr id="tr3">
<td ><input type=checkbox id="box3"></td>
<td>第三行</td>
</tr>
</table>
<br />
<input type="button" id="add" onclick="addRow();" value="Add Row" />
</body>
</html>一段简单的代码 自己修改下