代码之家  ›  专栏  ›  技术社区  ›  Achilles

使用JQuery sortable插件防止表头可排序

  •  5
  • Achilles  · 技术社区  · 14 年前

    <table id="HatedByCSSOnlyGoons">
       <tr><td>Header 1</td><td>Header 2</td></tr>
       <tr><td>Data</td><td>Data</td></tr>
       <tr><td>Data</td><td>Data</td></tr>
    </table>
    

    我正在应用JQuery Sortable插件:

    <script language="javascript">
        $(document).ready(
            function() {
    
                $("#HatedByCSSOnlyGoons tbody").sortable();
    
                $("#HatedByCSSOnlyGoons tbody").disableSelection();
    
            }
    
        );
    </script>
    

    sortable() ?

    1 回复  |  直到 14 年前
        1
  •  8
  •   theycallmemorty    14 年前

    <thead> <td> <th> :

    <table id="HatedByCSSOnlyGoons">
       <thead>
           <tr><th>Header 1</th><th>Header 2</th></tr>
       </thead>
       <tbody>
           <tr><td>Data</td><td>Data</td></tr>
           <tr><td>Data</td><td>Data</td></tr>
       </tbody>
    </table>