javascript - how to remove the header of the table when using react-bootstrap-table-next
问题描述
I am using react-bootstrap-table-next to generate a table in my web app and I have data in the columns but I dont want the header to appear. As of now its an empty header with no text but I want that header section to be gone if possible. As you can see from the image below, that small header space is what I want to be gone. I have tried researching online but nothing I have found seems to work. I tried display: none
as suggested but no luck.
The code below is what I am using to generate the table above. Any guidance or pointers I can use to make that header disappear or is that not possible when using this react library.
解决方案
我从来没有使用过那个库,只使用带有 sass 的引导程序,然后将引导程序编译到项目中。看起来文档说您可以添加属性 headerTitle: true,所以我想您可以尝试将其设置为 false 并查看是否有效。
但你是对的,那是行不通的。我发现了这个其他属性,它对我有用。 headerAttrs:{隐藏:真}
const columns = [{
dataField: 'id',
text: 'Product ID',
headerAttrs: {
hidden: true
}
}, {
dataField: 'name',
text: 'Product Name',
headerAttrs: {
hidden: true
}
}, {
dataField: 'price',
text: 'Product Price',
headerAttrs: {
hidden: true
}
}];
请让我知道这对你有没有用。
推荐阅读
- python - 使用登录页面在 Python 中进行 Web 抓取
- r - 强制ggplot2中一个方面的x轴标签
- java - 从 Java 8 中的过滤器和映射调用自定义静态函数 - 流
- swift - 为什么类的常量实例可以在属性值中更改?
- java - 在socket通信中设置FIN & RST
- python - 使用 numpy. binary_repr 上的数字或替代数组 - Python
- python - 如何将Django源安装转换为包安装
- mysql - mysql中使用count()和join时返回错误值
- graph - 如何将单元格中的字符串用作图形数据范围?
- python - 错误 - OSError:读取文件“http://website”时出错,无法加载外部实体“http://website/alpha.html”