<HTML>
<head>
<script language="javascript">
var curRow=null;
function SelectRow(TrObj){
if(curRow) curRow.style.backgroundColor="#FFFFFF";
TrObj.style.backgroundColor="#FFCC00";
curRow=TrObj;
}
function CalTotalScore(){
}
function ToModify(){
var pWin=window.open("","","width=200px,height=150px,left="+(screen.width-200)/2+",top="+(screen.height-150)/2);
pWin.document.write(divOpen.innerHTML);
pWin.document.all.txtMath.value=curRow.cells[1].innerText;
pWin.document.all.txtHis.value=curRow.cells[2].innerText;
pWin.document.all.txtEng.value=curRow.cells[3].innerText;
}
</script>
</head>
<body>
<table align="center" width="500" border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse " bordercolor="#111111">
<tr>
<td width="100" align="center">姓名</td>
<td width="100" align="center">数学</td>
<td width="100" align="center">历史</td>
<td width="100" align="center">外语</td>
<td width="100" align="center">总分</td>
</tr>
<tr>
<td align="center">张三</td>
<td align="right">78</td>
<td align="right">92</td>
<td align="right">85</td>
<td align="right"> </td>
</tr>
<tr>
<td align="center">李四</td>
<td align="right">82</td>
<td align="right">68</td>
<td align="right">91</td>
<td align="right"> </td>
</tr>
<tr>
<td align="center" colspan="5">
<input type="button" value="修改">
<input type="button" value="关闭">
</td>
</tr>
</table>
<div id="divOpen" style="display:none ">
<script language="javascript">
function doSave(){
var opener=window.opener;
opener.curRow.cells[1].innerText=txtMath.value;
opener.curRow.cells[2].innerText=txtHis.value;
opener.curRow.cells[3].innerText=txtEng.value;
}
</script>
<table width="80%" align="center" border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse " bordercolor="#111111">
<tr>
<td width="40%" align="right">数学; </td>
<td width="60%"><input type="text" id="txtMath" style="width:100% "></td>
</tr>
<tr>
<td align="right">历史; </td>
<td><input type="text" id="txtHis" style="width:100% "></td>
</tr>
<tr>
<td align="right">外语; </td>
<td><input type="text" id="txtEng" style="width:100% "></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="button" value="保存"></td>
</tr>
</table>
</div>
</body>
</html>
分享到:
相关推荐
JavaScript操作表格JavaScript操作表格JavaScript操作表格
关于javascript 的表格操作的一些函数集合
javascript 表格操作
javascript动态操作表格 1.添加表格 2.删除表格 3.选种表格 4.支持IE6.0和Firefox浏览器
经过多次应用后总结的对表格的经典操作,动态增加行,删除行,全选,删除全部等等...
javascript操作表格
静态实现javascript,实现表格的增加和删除等功能,值得初学者学习
JavaScript动态操作表格,添加,删除行、列及单元格
javascript操作表格的各种方法,多种源代码的集合.呵呵.整理好几天了
1.动态创建表格 2.表格具有间隔行颜色 3.具有鼠标进过高亮显示 4.可以进行编辑和删除 5.可以全选,全清,反选 6.编辑时可以显示下拉框,单选框和复选框
JS自动添加,删除表格总结,及window窗体居中。内含源代码!!!!
基于javascript实现表格的简洁操作_.docx
Javascript操作表格 包括获取值,创建表格
主要用到了元素的克隆,如何在各浏览器中兼容,并且在IE中如何统计动态操作后的行列数
主要介绍了JavaScript表格常用操作方法,实例汇总了javascript中表格操作的创建、添加、删除、遍历等常用操作技巧,具有一定参考借鉴价值,需要的朋友可以参考下
可用于多选操作等等
1.动态创建表格 2.兼容IE和FireFox 3.具有间隔色 4.具有鼠标进过高亮显示功能 5.具有编辑和删除功能,每行附带有编辑和删除按钮 6.具有全选,全清和反选功能
对表格的编辑实现,内部有几个demo,使用者可迅速上手 对表格的编辑实现,内部有几个demo,使用者可迅速上手
主要介绍了javascript实现对表格元素进行排序操作,分别可以实现点击之后排序和还原,和排升序和降序的功能,文章末尾附完整代码,感兴趣的小伙伴们可以参考一下