【发布时间】:2017-05-11 14:00:21
【问题描述】:
我需要以编程方式设置BootstrapTable 元素的高度(因为我想确保表格占据浏览器窗口底部的可用空间)。我尝试使用 CSS 类 react-bs-table 设置 div 的 CSS 属性 height(如果我在 BootstrapTable 元素的 height 属性中设置它,这就是高度的位置)。看起来像这样:
componentDidMount() {
// Calculate the height
let height = 200; // Only simluated here!
// Set the height
const tableElement = document.getElementsByClassName('react-bs-table')[0];
tableElement.style.height = height + 'px';
}
这种方法的问题是BootstrapTable 的数据行溢出了它的底部边框。似乎这个溢出的高度就是标题的高度。
如何正确设置BootstrapTable 的高度(数据行不会溢出元素)?
【问题讨论】:
标签: reactjs react-bootstrap-table