我使用 react-bootstrap-table
并且需要垂直滚动。
我的代码:
<BootstrapTable data={products} hover>
<TableHeaderColumn isKey dataField='id' width='10%'>
Product ID
</TableHeaderColumn>
<TableHeaderColumn dataField='name'>
Product Name
</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
这段代码工作正常,我得到了自动调整宽度的表格。 之后,我添加了下一个键:
<BootstrapTable data={products} hover height='200px'>
并且 100% width
出现问题,我没有调整表格宽度,而是得到了一个如下图所示的滚动条:
最佳答案
我还打开了issue图书馆的创建者提出了解决方案:
You have to add
printable
key onBootstrapTable
此外,我还在 BootstrapTable
上添加了 bodyStyle={{overflow: 'overlay'}}
。
关于html - react-bootstrap-table 宽度的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46003460/