html boot设置列宽,《前端》bootstrapTable表头调整列宽

需要引入的文件:

bootstrapTable基本引入文件:

bootstrap-3.3.4.css、bootstrap-table.min.css、jquery-3.5.1.min.js、bootstrap-3.3.7.min.js、bootstrap-table.min.js

表头调整列宽需要再引入:

colResizable-1.6.js

代码:

bootstrapTable表头调整列宽

$('#table_sortShowNorm').bootstrapTable({

undefinedText: '', // 当数据为undefined时显示的字符,默认是'-'

toolbar: 'false', // 工具按钮用哪个容器

toolbarAlign: 'false', // 工具按钮的位置

striped: false, // 是否显示行间隔色

pagination: false, //是否分页

uniqueId: "tid", // 每一行的唯一标识,一般为主键列

field: 'checked',

checkbox: true,

showColumns: false, // 是否显示列的按钮

// reorderableRows: true, //设置拖动排序

// useRowAttrFunc: true, //设置拖动排序

columns: [{

field: 'checked',

checkbox: true,

}, {

title: '序号',

formatter: function(value, row, index) {

return index + 1;

},

align: 'center'

}, {

field: 'name',

title: '名称',

align: 'center',

cellStyle: {

css: {

"text-align": "center !important"

}

}

}],

data: [{

"name": "wdwdwdd"

}, {

"name": "jdiwjdi"

}],

// responseHandler: function(res) {

// if (res.success) {

// $('#input_cacheId').val(res.data.tid);

// $('#input_modifyTime').val(res.data.modifyTime);

// var data = res.data.treeDto;

// return data;

// } else {

// CommonJS.modal.alertError(res.message);

// }

// return res;

// }

});

$('#table_sortShowNorm').colResizable({

liveDrag: true, //拖动列时更新表布局

gripInnerHtml: "

draggingClass: "dragging",

resizeMode: 'overflow' //允许溢出父容器

});

标签:bootstrapTable,false,true,res,表头,js,table,列宽,data

来源: https://blog.csdn.net/bellediao/article/details/110696750

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值