码迷,mamicode.com
首页 > 其他好文 > 详细

关于bootstrap table 固定列宽

时间:2019-12-04 11:48:31      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:lin   name   lis   ble   trap   span   page   height   idt   

首先为table 设置 style="table-layout: fixed;"
 <table id="assessStage" data-height="467" data-mobile-responsive="true" style="table-layout: fixed;">
                </table>
然后在下方columns 处设置width
$(‘#assessStage‘).bootstrapTable({
            method: ‘get‘,
            url: "xxx",
            btn: true,
            pagination: true,
            pageSize: 10,
            pageNumber: 1,
            pageList: [10, 15, 30],//分页步进值
            striped: true,
            dataField: "list",
            iconSize: ‘outline‘,
            icons: {
                refresh: ‘glyphicon-repeat‘,
                toggle: ‘glyphicon-list-alt‘,
                columns: ‘glyphicon-list‘
            },
            columns: [
                [
                    {
                        field: ‘student_name‘,
                        title: ‘姓名‘,
                        align: ‘center‘,
                        colspan: 1
                        ,width:100
                    },
                    {
                        field: ‘hospital_name‘,
                        title: ‘带教单位‘,
                        align: ‘center‘,
                        colspan: 1
                        ,width:200
                    },
                    {
                        field: ‘teacher_name‘,
                        title: ‘指导老师‘,
                        align: ‘center‘,
                        colspan: 1
                        ,width:100
                    },
                    {
                        field: ‘start_time‘,
                        title: ‘开始时间‘,
                        align: ‘center‘,
                        colspan: 1,
                        width:100
                    }
                ]
            ]
        });

关于bootstrap table 固定列宽

标签:lin   name   lis   ble   trap   span   page   height   idt   

原文地址:https://www.cnblogs.com/zhuyeshen/p/11981916.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!