Bootstrap给表格设置宽度不起作用

更改名称为table的class
将table-layout属性设置为fixed

.table{
    
    
	table-layout: fixed;
}

js中初始化表格时,在columns中指定width属性

columns: [
    {
    
    
        field: 'id',
        title: 'id',
        align: 'center', // 左右居中
        valign: 'middle', // 上下居中
        width:50,
    }
]

猜你喜欢

转载自blog.csdn.net/qq_39997939/article/details/125108180
今日推荐