jQuery拖動調整表格列寬度-resizableColumns

來源:互聯網
上載者:User

實現滑鼠可拖動調整表格列寬度


一、引入檔案:

<script src="/js/jquery-1.8.0.min.js" type="text/javascript"></script><script src="/js/store.js" type="text/javascript"></script><script src="/js/jquery.resizableColumns.js" type="text/javascript"></script>

二、TABLE

<table id="myTable" border="1">    <thead>     <tr>      <th data-resizable-column-id="a"><input type="checkbox" /></th>      <th data-resizable-column-id="b">欄目類型 </th>      <th data-resizable-column-id="c">活動名稱 </th>      <th data-resizable-column-id="d">狀態 </th>      <th data-resizable-column-id="e">操作選項</th>     </tr>    </thead>    <tbody>     <tr>      <td><input type="checkbox" /></td>      <td>青春日記</td>      <td>2014年度青春日記徵文 </td>      <td>提交 </td>      <td>審核</td>     </tr>     <tr>      <td><input type="checkbox" /></td>      <td>我和孩子的成長故事</td>      <td>成長故事 </td>      <td>通過 </td>      <td>審核</td>     </tr>    </tbody> </table>
以上html只是作為Demo 並不是我項目中所實際使用的,並且在測試的時候  也未能實現。鬱悶...


三、實現表格可拖動

<script type="text/javascript">    $(function(){$("#myTable").resizableColumns({     store: window.store});    })</script>

在項目使用過程中 發現無需引入store.js <th>也無需data-resizable-column-id屬性

並且$("#myTable").resizableColumns();也可實現功能

所需檔案:http://download.csdn.net/detail/itmyhome/7390263

分別解壓兩個檔案

jquery.resizableColumns.js在\jquery-resizable-columns-gh-pages\dist路徑下

store.js在store.js-master路徑下


歡迎加入JAVA技術交流群:74955800



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.