jQuery实现表头固定效果的实例代码

2020-05-24 21:29:30易采站长站整理


        jQuery(function() {


            jQuery.fn.CloneTableHeader(“tab1”, “div1”);


        });


    </script>


</head>


<body>


    <form id=”form1″ runat=”server”>


    <div style=” height: 250px; overflow:scroll;” id=”div1″>


        <table cellpadding=”0″ id=”tab1″ cellspacing=”0″ border=”0″ class=”itemList”>


            <thead>


                <tr style=”background-color: #eeeeee; margin: 0px; line-height: 20px; font-weight: bold;


                    padding: 0px 0px 0px 0px;”>


                    <td>


                        列1


                    </td>


                    <td>


                        列2


                    </td>


                    <td>


                        列3


                    </td>


                    <td>


                        列4


                    </td>


                </tr>