jQuery Table Column Resizing Plugin colResizable.js

Add-ons
2026-07-26 04:24 6 次浏览 • 0 次下载 14.8KB
jQuery Table Column Resizing Plugin colResizable.js

colResizable.js

  • Compatible with mouse and touch devices (PCs, tablets, and mobile phones)

  • Compatible with percentage-based and pixel-based table layouts

  • Resize columns without changing the overall table width (optional)

  • No external resources required (such as images or stylesheets)

  • Optional layout persistence after page refreshes or postbacks

  • Customizable column handles

  • Small footprint (colResizable 1.0 is only 2 KB)

  • Events

Usage Instructions

To use this plugin, once jQuery has been loaded, add a script reference to colResizable.min.js in the head section of the document. To enhance a table or a collection of tables, select it using a jQuery wrapper and apply the colResizable() method.

1
2
<script src="colResizable-1.6.js"></script>

html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<table id="myTable" border="0" width="100%" >
<thead>
<tr>
<th data-resizable-column-id="a"><input type="checkbox" /></th>
<th data-resizable-column-id="b">Category Type </th>
<th data-resizable-column-id="c">Activity Name </th>
<th data-resizable-column-id="d">Status </th>
<th data-resizable-column-id="e">Action Options</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" /></td>
<td>Youth Diary</td>
<td>2014 Youth Diary Writing Contest </td>
<td>Submitted </td>
<td>Under Review</td>
</tr>
<tr>
<td><input type="checkbox" /></td>
<td>My Child and I: Our Growing-Up Story</td>
<td>Growing-Up Story </td>
<td>Approved </td>
<td>Under Review</td>
</tr>
</tbody>
</table>
</div>

js

1
2
3
4
5
6
7
$(function() {
$("table").colResizable({
liveDrag: true, // Display the dragging position in real time
gripInnerHtml: "<div class='grip'></div>",
postbackSafe: true, // Preserve the previously dragged column widths after refreshing
});
})
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare