首页 > 其他 > 详细

为表格添加可调整列宽功能

时间:2018-04-16 17:23:55      阅读:199      评论:0      收藏:0      [点我收藏+]
1、引入js架包

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

  <script src="js/colResizable-1.6.js" type="text/javascript"></script>  (该jar包是为表格添加列宽自定义功能)

2、table页面内容

  <table id="contentTable"
  class="table table-striped table-bordered table-condensed">
    <thead>
      <tr>
        <th>标题</th>
        <th>类型</th>
        <th class="sort-column login_name">状态</th>
        <th class="sort-column name">查阅状态</th>
        <th>更新时间</th>
     </tbody>
  </table>

技术分享图片

 

  4、js代码

  <script type="text/javascript">

    $(function() {

       $("table").colResizable();

     });

  </script>

 这样为你的表单加上table样式,你的表格就可以自定义拉升大小了。

4、附上官网地址

  jQuery插件来调整表列的大小


  官网地址:http://www.bacubacu.com/colresizable/

 

 colResizable-1.6插件下载地址:https://download.csdn.net/download/oranxiaoluo/10352596

 

为表格添加可调整列宽功能

原文:https://www.cnblogs.com/gywenlover/p/8856397.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!