分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

jQuery拖动调整表格列宽度-resizableColumns

发布时间:2023-09-06 02:31责任编辑:沈小雨关键词:jQuery

实现鼠标可拖动调整表格列宽度 如图:

 

一、引入文件:

<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路径下

------------------------分割线----------------------------

如果未实现效果,可使用 colResizable 插件

参考: http://blog.itmyhome.com/2016/05/jquery-colresizable  

                                                                             2016-05-05

???????????

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

jQuery拖动调整表格列宽度-resizableColumns

原文地址:https://www.cnblogs.com/skiwnchqhh/p/10333552.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved