使表格的标题列可左右拉伸jquery插件封装(2)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <title></title>
    <style type="text/css" >
        td{ text-align:center;}
    </style>
    <script type="text/javascript" src="https://www.jb51.net/script/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="https://www.jb51.net/script/jquery.tableresize.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //使两张table同时支持左右拉伸
            $("table").tableresize();
        });
    </script>
</head>
<body>
    表格1<br/>
    <table cellspacing="0" rules="all">
        <tbody><tr>
            <td>ID</td><td>名字</td><td>年纪</td><td>地址</td><td>电话</td>
        </tr><tr>
            <td>22</td><td>Name:44</td><td>Age:23</td><td>Address:47</td><td>Phone:15</td>
        </tr><tr>
            <td>28</td><td>Name:42</td><td>Age:68</td><td>Address:30</td><td>Phone:50</td>
        </tr><tr>
            <td>29</td><td>Name:63</td><td>Age:48</td><td>Address:90</td><td>Phone:76</td>
        </tr>
    </tbody>
    </table>
    <br/>表格2<br/>
    <table cellspacing="0" rules="all">
        <tbody><tr>
            <td>ID</td><td>名字</td><td>年纪</td><td>地址</td><td>电话</td>
        </tr><tr>
            <td>22</td><td>Name:44</td><td>Age:23</td><td>Address:47</td><td>Phone:15</td>
        </tr><tr>
            <td>28</td><td>Name:42</td><td>Age:68</td><td>Address:30</td><td>Phone:50</td>
        </tr>
    </tbody></table>
</body>
</html>

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgswgx.html