高分求表格操作代码(插入行\插入列) 插入行:myNewRow = document.all.myTable.insertRow()插入列:myNewCell = document.all.myTable.rows[0].insertCell() 抛个砖头 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我的网站 http://www.bjcan.com/hengxing<style>body,td,div,a,input{font:menu;line-height:150%}</style><table cellspacing=1 cellpadding=1 border=0 width=100% id=t136><tbody><form method=post enctype="multipart/form-data"><input type=hidden name=deal value=true><input type=hidden name=frmID value=22><input type=hidden name=thisdir value=><input type=hidden name=TID value=><tr style="font-weight: bold" bgcolor=ACD0FD><td colspan=2>呵呵</td></tr><tr bgcolor=EFEFD6><td colspan=2><font color=000080>哈哈</font></td></tr><input type=hidden name=frmShowURL value=payment><input type=hidden name=ID value=><tr bgcolor=F0F0F0><td>xixi</td><td>xixi </td></tr><tr bgcolor=F9F9F9><td>hehe</td><td><input type=text class=border_index name=newdir style='ime-mode:disabled'><font color=000080>hehe</font> </td></tr><tr bgcolor=F0F0F0><td>新图片上传</td><td><div><input type=button onclick=addNew() value=增加 class=button_index><font color=000080>(按一次增加按钮就可以上传一张图片。)</font></div></td></tr><tbody></table></form><script>var i=0,arr=new Array('F9F9F9','F0F0F0');function addNew(){ tr=document.all.t136.insertRow(); tr.style.backgroundColor=arr[i%2]; tr.insertCell().innerText="图片"+(++i); tr.insertCell().innerHTML='<input type=file name=pic'+i+' class=border_index> <a href=javascript:void(0) onclick=del()>删除</a>'}function del(){ document.all.t136.deleteRow(window.event.srcElement.parentElement.parentElement.rowIndex); for(i=0;i<document.all.t136.rows.length-5;i++){ document.all.t136.rows[i+5].cells[0].innerText="图片"+(i+1); document.all.t136.rows[i+5].cells[1].children[0].name="pic"+(i+1); document.all.t136.rows[i+5].style.backgroundColor=arr[i%2]; }}</script> var theTable=document.getElementById("tableid");var newRow=theTable.insertRow();var newCell=newRow.insertCell();newCell.innerText="列"; 请问怎样在某个元素的两边插入一个元素??? 从服务器端的数据库中读取一条记录,将记录内容写到数组中,然后将该数组的内容写到客户端的数组 请问location这样用错在哪里? JS的一个小问题,简直是白给分 如何使系统只能打开一个页签,要打开另外一个,则要关闭已经打开的 ExtJS GridPanel加上复选框之后,行选中问题 地址栏里如何加标志呀,高手们,帮我呀, 当用户在select下拉框中只输入一个字时,程序立即把该值的其它信息给显示出来? 求个JavaScript权威教材 视频进度条预览技术如何实现? 如何去单元格的行号??? 通过js如何让最小化的窗口闪动,而不是弹出?
我的网站 http://www.bjcan.com/hengxing
<style>body,td,div,a,input{font:menu;line-height:150%}</style>
<table cellspacing=1 cellpadding=1 border=0 width=100% id=t136>
<tbody>
<form method=post enctype="multipart/form-data">
<input type=hidden name=deal value=true>
<input type=hidden name=frmID value=22>
<input type=hidden name=thisdir value=>
<input type=hidden name=TID value=>
<tr style="font-weight: bold" bgcolor=ACD0FD>
<td colspan=2>呵呵</td></tr><tr bgcolor=EFEFD6>
<td colspan=2><font color=000080>哈哈</font></td>
</tr>
<input type=hidden name=frmShowURL value=payment><input type=hidden name=ID value=><tr bgcolor=F0F0F0><td>xixi</td><td>xixi </td></tr><tr bgcolor=F9F9F9><td>hehe</td><td><input type=text class=border_index name=newdir style='ime-mode:disabled'><font color=000080>hehe</font> </td></tr><tr bgcolor=F0F0F0><td>新图片上传</td><td><div>
<input type=button onclick=addNew() value=增加 class=button_index><font color=000080>(按一次增加按钮就可以上传一张图片。)</font></div></td></tr><tbody></table></form>
<script>
var i=0,arr=new Array('F9F9F9','F0F0F0');
function addNew(){
tr=document.all.t136.insertRow();
tr.style.backgroundColor=arr[i%2];
tr.insertCell().innerText="图片"+(++i);
tr.insertCell().innerHTML='<input type=file name=pic'+i+' class=border_index> <a href=javascript:void(0) onclick=del()>删除</a>'
}
function del(){
document.all.t136.deleteRow(window.event.srcElement.parentElement.parentElement.rowIndex);
for(i=0;i<document.all.t136.rows.length-5;i++){
document.all.t136.rows[i+5].cells[0].innerText="图片"+(i+1);
document.all.t136.rows[i+5].cells[1].children[0].name="pic"+(i+1);
document.all.t136.rows[i+5].style.backgroundColor=arr[i%2];
}
}
</script>
var newRow=theTable.insertRow();
var newCell=newRow.insertCell();
newCell.innerText="列";