表格删除问题,各位大虾帮忙,谢谢

itblog itblog 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
存成html文件,就知道我想要说的了,谢谢了,现在删除有点问题,点某一个就全删了。

<html>
<head>
<title>tree</title>
<meta name="designer" content="csdn design team - meizz" />
<script>
function delRow()
{
var rowIndex = event.srcElement.parentNode.parentNode.rowIndex;
event.srcElement.parentNode.parentNode.removeNode(true);
for (var i = rowIndex; i < mytable.rows.length; i++)
{
mytable.rows(i).cells(0).innerHTML = i;
}
}
</script>
</head>
<body>
要显示的内容:
<form name="frm1" method="post" action="/addcontent.jsp">
<table id="mytable" border="1" width="100%">
<tr>
<td width="100%" valign="top" >
<table border="1" width="100%" class="dragTable">
<tr >
<td width="15%" align="right" bgcolor="#cccccc">标题:</td>
<td width="77%" bgcolor="#cccccc">
<input type="text" name="title_3" style="width:100" value="小儿子">
</td>
<td rowspan="2" width="8%" >
<input id="Button_3" type="button" value="删除ID为3的行" onclick="delRow()"/>
</td>
</tr>
<tr >
<td width="15%" align="right" bgcolor="#cccccc">内容:</td>
<td width="77%" >动态给表格增加/删除一行
</td>
</tr>
</table>

<table border="1" width="100%">
<tr >
<td width="15%" align="right" bgcolor="#cccccc">标题:</td>
<td width="77%" bgcolor="#cccccc">
<input type="text" name="title_7" style="width:100" value="二儿子">
</td>
<td rowspan="2" width="8%" >
<input id="Button_7" type="button" value="删除ID为7的行" onclick="delRow()" />
</td>
</tr>
<tr >
<td width="15%" align="right" bgcolor="#cccccc">内容:</td>
<td width="77%" >动态给表格增加/删除一行
</td>
</tr>
</table>

</td>
</tr>
</table>
</body>
</html>
...全文

相关推荐

C程序优化方案.pdf

C程序优化方案.pdf

hhappy0123456789

python如何读取excel表格的数据呢?xlrd pandas模块

平常我们在测试的过程中需要用到测试用例,那么如何用Python去读取excel数据呢,以下是我所学习的过程: 一:安装第三方库 输入 win+r -----&gt; cmd ------&gt;输入以下pip的命令 (两个模块任选其一即可) pip install xlrd pip install pandas 二:使用xlrd模块读取excel数据 我的excel的数据是这样的: 接下...

winky_1

Python:xlrd和xlwt模块操作Excel使用详解

python提供了从Excel表格中读取数据的模块xlrd,和xlwt模块将数据写入Excel表格。 xlrd和xlwt模块需要我们自己安装。 1.准备工作 1.安装 外网安装方法 pip install xlrd pip install xlwt 内网安装方法 a.在python官网下载http://pypi.python.org/pypi/xlrdxlrd下载xlrd的安装包。 b.压...

tomorrownan

python xlrd模块下载_python使用xlrd模块读写Excel文件的方法

本文实例讲述了python使用xlrd模块读写excel文件的方法。分享给大家供大家参考。具体如下:一、安装xlrd模块到python官网下载http://pypi.python.org/pypi/xlrd模块安装,前提是已经安装了python 环境。二、使用介绍1、导入模块复制代码 代码如下:import xlrd2、打开Excel文件读取数据复制代码 代码如下:data = xlrd.open...

weixin_39876450

python3之读取Excel文件(xlrd库)

一、安装xlrd模块 Python读取Excel文件可以使用 xlrd(读取)、xlwt(写入) 和 openpyxl 这两个库,区别在于:xlrd 和 xlwt 库同时支持 xls 和 xlsx 这种格式excel文件,openpyxl 库仅支持 xlsx 格式文件 1、Windows下Pythonxx\Lib\site-packages目录下安装命令: pip install xlrd pip install openpyxl 2、验证安装是否成功: 新建python文件,导入import xlrd,不

ZXALI
评论 10
收藏 已收藏
分享
返回顶部
itblog
JavaScript 87,983 成员 224,681 内容