Home >php教程 >php手册 >php对报表进行批量操作如全选反选删除功能

php对报表进行批量操作如全选反选删除功能

WBOY
WBOYOriginal
2016-06-06 19:42:501627browse

php对表格进行批量操作如全选反选删除功能 !DOCTYPEhtmlhead meta http-equiv="content-type" content="text/html" charset="utf-8" titleSelect All/title style table{ border : # 999 1px solid; border-collapse: collapse; } table th{ text -align: cen

php对表格进行批量操作如全选反选删除功能



    <meta http-equiv="content-type" content="text/html" charset="utf-8">
    <title>Select All</title>
    <style><span style="color: #000000;">
        table{
            border:<span style="color: #008000;">#<span style="color: #008000;">999 1px solid;
            border-collapse:<span style="color: #000000;">collapse;
        }
        table th{
            text-align:<span style="color: #000000;">center;
        }
        table td{
            border:1px solid <span style="color: #008000;">#<span style="color: #008000;">999;
            text-align:<span style="color: #000000;">center;
        }
        .<span style="color: #000000;">one{
            background:<span style="color: #008000;">#<span style="color: #008000;">6cf;
<span style="color: #000000;">        }
        .<span style="color: #000000;">two{
            background:<span style="color: #008000;">#<span style="color: #008000;">fc6;
<span style="color: #000000;">        }
    </style>

    <script type="text/javascript" language="javascript">
        <span style="color: #0000ff;">function<span style="color: #000000;"> changecolor(){
            <span style="color: #0000ff;">var tr=document.getElementsByTagName("tr"<span style="color: #000000;">);
            tr[0].style.background="#0066ff"<span style="color: #000000;">;
            tr[tr.length-1].style.background="#0066ff"<span style="color: #000000;">;
        }
        <span style="color: #0000ff;">function<span style="color: #000000;"> changebox(type) {
            <span style="color: #0000ff;">var tbs = document.getElementById("tbs"<span style="color: #000000;">);
            <span style="color: #0000ff;">var chks = tbs.getElementsByTagName("input"<span style="color: #000000;">);
            <span style="color: #0000ff;">switch<span style="color: #000000;"> (type) {
                <span style="color: #0000ff;">case "qx":
                    <span style="color: #0000ff;">for (<span style="color: #0000ff;">var i = 0; i < chks.length; i++<span style="color: #000000;">) {
                        chks[i].checked = <span style="color: #0000ff;">true<span style="color: #000000;">;
                    }
                    <span style="color: #0000ff;">break<span style="color: #000000;">;
                <span style="color: #0000ff;">case "qxx":
                    <span style="color: #0000ff;">for (<span style="color: #0000ff;">var i = 0; i < chks.length; i++<span style="color: #000000;">) {
                        chks[i].checked = <span style="color: #0000ff;">false<span style="color: #000000;">;
                    }
                    <span style="color: #0000ff;">break<span style="color: #000000;">;
                <span style="color: #0000ff;">case "fx":
                    <span style="color: #0000ff;">for (<span style="color: #0000ff;">var i = 0; i < chks.length; i++<span style="color: #000000;">) {
                        <span style="color: #0000ff;">if (chks[i].checked == <span style="color: #0000ff;">true<span style="color: #000000;">) {
                            chks[i].checked = <span style="color: #0000ff;">false<span style="color: #000000;">;
                        } <span style="color: #0000ff;">else<span style="color: #000000;"> {
                            chks[i].checked = <span style="color: #0000ff;">true<span style="color: #000000;">;
                        }
                    }
                    <span style="color: #0000ff;">break<span style="color: #000000;">;
            }
        }
        <span style="color: #0000ff;">function<span style="color: #000000;"> del(){
            <span style="color: #0000ff;">var input=document.getElementsByName("check[]"<span style="color: #000000;">);
            <span style="color: #0000ff;">for(<span style="color: #0000ff;">var i=input.length-1; i>=0; i--<span style="color: #000000;">){
                <span style="color: #0000ff;">if(input[i].checked==<span style="color: #0000ff;">true<span style="color: #000000;">){
                    <span style="color: #0000ff;">var td=input[i].<span style="color: #000000;">parentNode;
                    <span style="color: #0000ff;">var tr=td.<span style="color: #000000;">parentNode;
                    <span style="color: #0000ff;">var table=tr.<span style="color: #000000;">parentNode;
                    table.<span style="color: #000000;">removeChild(tr);
                }
            }
        }
    </script>


class="one"> class="two"> class="one"> class="two"> class="one"> class="two"> class="one"> 【本文来自鸿网互联 (http://www.68idc.cn)】
选项 发件人 邮件名称 邮件附属信息
王大力 wdl@qq.com 个人邮箱
王大力 wdl@qq.com 个人邮箱
王大力 wdl@qq.com 个人邮箱
王大力 wdl@qq.com 个人邮箱
王大力 wdl@qq.com 个人邮箱
王大力 wdl@qq.com 个人邮箱
王大力 wdl@qq.com 个人邮箱
选项

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn