BootStrapTable.JS 单元格不换行的实现

本文介绍如何使用 BootStrapTable 的 width 属性来实现表格列宽的自适应及指定宽度,避免文本过长导致的自动换行问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

字段过长容易导致 BootStrapTable.JS 实现的 Table 文字自动换行。

The width of column. If not defined, the width will auto expand to fit its contents. Also you can add '%' to your number and the bootstrapTable will use the percentage unit, otherwise, you can add or no the 'px' to your nu

通过 width 【data-width 】 属性实现行宽的自动扩展,此处扩展行宽不一定实现指定宽度,【Number {Pixels or Percentage}】。

但均宽都实现了不换行自适应。

代码示例

{
    field: 'memberName',
    title: '会员',
    align: 'center',
    width:200
},


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值