表格删除一行

Posted yonyong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了表格删除一行相关的知识,希望对你有一定的参考价值。

<!--删除表格指定行/删除表格某行/删除表格一行-->
<table class="table table-hover table-bordered" id="resetApplyTable" style="table-layout:fixed;min-width:142%;">
    <thead>
        <tr>
            <th class="text-center fixFirstColum" style="width: 121px">人员姓名&nbsp;<font color='red'>*</font></th>
            <th class="text-center" style="width: 237px">身份证号</th>
            <th class="text-center" style="width: 118px">身份</th>
            <th class="text-center" style="width: 227px">绑定关系</th>
            <th class="text-center" style="width: 220px">手机号</th>
            <th class="text-center" style="width: 200px">IMSI1</th>
            <th class="text-center" style="width: 200px">IMSI2</th>
            <th class="text-center" style="width: 88px">运营商</th>
            <th class="text-center" style="width: 194px">终端型号</th>
            <th class="text-center" style="width: 137px">密码模块类型</th>
            <th class="text-center" style="width:80px">操作</th>
        </tr>
    </thead>
    <tbody  id="zaicitishenbody">
        
    </tbody>
</table>
function test()
    zaicitishenbody.deleteRow(i);
    <!--或者-->
    $("#zaicitishenbody")[0].deleteRow(0);
    <!--第一个没用选择器,zaicitishenbody拿到的是html片段,如附录A。能成功,神奇-->
<!--附录A:-->
<tbody id="zaicitishenbody"><tr><td class="text-center fixFirstColum" name="1700255" style="white-space:normal;padding-top: 17px;"><div class="" title="江永志">江永志</div></td><td class="text-center" name="1700255" style="white-space:normal;padding-top: 20px;"><div class="" title="330102197107260918">330102197107260918</div></td><td class="text-center" name="1700255" style="white-space:normal;padding-top: 17px;"><div class="" title="民警">民警</div></td><td class="text-center" name="1700255" style="white-space:normal;padding-top: 20px;"><br></td><td class="text-center" name="1700255" style="white-space:normal;padding-top: 20px;"><div id="zaiCiTiShenPhone1700255" contenteditable="true" class="autocut" title="4600236892213">4600236892213</div></td><td class="text-center" name="1700255" style="white-space:normal;padding-top: 20px;"><div id="zaiCiTiShenIMSI11700255" contenteditable="true" name1="imsi" class="autocut1" title="460023689285201">460023689285201</div></td><td class="text-center" name="1700255" style="white-space:normal;padding-top: 20px;"><div id="zaiCiTiShenIMSI21700255" contenteditable="true" class="autocut" title=""></div></td><td class="text-center" name="1700255" style="white-space:normal;padding-top: 17px;"><div id="zaiCiTiShenOperators1700255" class="" title="移动">移动</div></td><td><select class="selectpicker show-tick form-control" style="width: -webkit-fill-available;" id="zaiCiTiShenTerminal1700255" name="selectTest"><option selected="selected" value="OPPOR9s" text="OPPOR9s">OPPOR9s</option><option value="vjvoop全网通(11)" text="vjvoop全网通(11)">vjvoop全网通(11)</option><option value="vivooo移动版(90)" text="vivooo移动版(90)">vivooo移动版(90)</option><option value="bva全网通(0)" text="bva全网通(0)">bva全网通(0)</option><option value="中兴ZTE()" text="中兴ZTE()">中兴ZTE()</option><option value="华为荣耀" text="华为荣耀">华为荣耀</option></select></td><td><select class="selectpicker show-tick form-control" style="width: -webkit-fill-available;" id="zaiCiTiShenAuthtype1700255" name="selectTest"><option selected="selected" value="360" text="360">360</option><option value="创原手机盾" text="创原手机盾">创原手机盾</option><option value="信大捷安" text="信大捷安">信大捷安</option><option value="中兴" text="中兴">中兴</option><option value="999" text="999">999</option><option value="ttt·1" text="ttt·1">ttt·1</option><option value="567" text="567">567</option><option value="a" text="a">a</option><option value="y" text="y">y</option><option value="test" text="test">test</option></select></td><td hidden="true">1700255</td><td class="text-center" style="white-space:normal;padding-top: 20px;"><a href="javascript:;" id="zaiCiTiShenSave1700255" onclick="saveZaicitishen(1700255)" class="iconfont icon-tijiao" style="margin-left:-1em"></a><a href="javascript:;" onclick="deleteOneRow(1700255)" class="iconfont icon-shanjian" style="margin-left:1em"></a></td></tr><tr><td class="text-center fixFirstColum" name="1700256" style="white-space:normal;padding-top: 17px;"><div class="" title="杨睿">杨睿</div></td><td class="text-center" name="1700256" style="white-space:normal;padding-top: 20px;"><div class="" title="330722198510220011">330722198510220011</div></td><td class="text-center" name="1700256" style="white-space:normal;padding-top: 17px;"><div class="" title="民警">民警</div></td><td class="text-center" name="1700256" style="white-space:normal;padding-top: 20px;"><br></td><td class="text-center" name="1700256" style="white-space:normal;padding-top: 20px;"><div id="zaiCiTiShenPhone1700256" contenteditable="true" class="autocut" title="413161551361">413161551361</div></td><td class="text-center" name="1700256" style="white-space:normal;padding-top: 20px;"><div id="zaiCiTiShenIMSI11700256" contenteditable="true" name1="imsi" class="autocut1" title="460023689296301">460023689296301</div></td><td class="text-center" name="1700256" style="white-space:normal;padding-top: 20px;"><div id="zaiCiTiShenIMSI21700256" contenteditable="true" class="autocut" title=""></div></td><td class="text-center" name="1700256" style="white-space:normal;padding-top: 17px;"><div id="zaiCiTiShenOperators1700256" class="" title="移动">移动</div></td><td><select class="selectpicker show-tick form-control" style="width: -webkit-fill-available;" id="zaiCiTiShenTerminal1700256" name="selectTest"><option selected="selected" value="OPPOR9s" text="OPPOR9s">OPPOR9s</option><option value="vjvoop全网通(11)" text="vjvoop全网通(11)">vjvoop全网通(11)</option><option value="vivooo移动版(90)" text="vivooo移动版(90)">vivooo移动版(90)</option><option value="bva全网通(0)" text="bva全网通(0)">bva全网通(0)</option><option value="中兴ZTE()" text="中兴ZTE()">中兴ZTE()</option><option value="华为荣耀" text="华为荣耀">华为荣耀</option></select></td><td><select class="selectpicker show-tick form-control" style="width: -webkit-fill-available;" id="zaiCiTiShenAuthtype1700256" name="selectTest"><option selected="selected" value="360" text="360">360</option><option value="创原手机盾" text="创原手机盾">创原手机盾</option><option value="信大捷安" text="信大捷安">信大捷安</option><option value="中兴" text="中兴">中兴</option><option value="999" text="999">999</option><option value="ttt·1" text="ttt·1">ttt·1</option><option value="567" text="567">567</option><option value="a" text="a">a</option><option value="y" text="y">y</option><option value="test" text="test">test</option></select></td><td hidden="true">1700256</td><td class="text-center" style="white-space:normal;padding-top: 20px;"><a href="javascript:;" id="zaiCiTiShenSave1700256" onclick="saveZaicitishen(1700256)" class="iconfont icon-tijiao" style="margin-left:-1em"></a><a href="javascript:;" onclick="deleteOneRow(1700256)" class="iconfont icon-shanjian" style="margin-left:1em"></a></td></tr></tbody>

以上是关于表格删除一行的主要内容,如果未能解决你的问题,请参考以下文章

表格增加一行/删除一行

表格删除一行

jQuery如何在表格中添加或者删除下一行

删除表格视图中的一行而不删除核心数据实体

一个radio在一行表格中。如何用JQuery,JS选择了radio后,获取那一行的属性。并在页面删除那一行

快速删除表格视图中的一行