在React Bootstrap表的标头组中使用过滤器

时间:2019-01-31 13:26:54

标签: javascript react-bootstrap-table

我正在尝试在react bootstrap表中使用过滤器,过滤器显示但它们未对齐you can see it here

这是我使用的代码:

                <BootstrapTable key={this.props.index}>

                <TableHeaderColumn columnTitle row='0' filter={filterBy} rowSpan='2' dataField='product' headerText='SSS' isKey>id</TableHeaderColumn>
                <TableHeaderColumn row='0' colSpan='2' headerAlign= 'center'>Product</TableHeaderColumn>
                <TableHeaderColumn row='1' filter={filterBy} dataField='prodDesc'>Name</TableHeaderColumn>
                <TableHeaderColumn row='1' filter={filterBy} dataField='standardCost'>Price</TableHeaderColumn>

                </BootstrapTable>

有什么办法可以使过滤器处于同一级别?

1 个答案:

答案 0 :(得分:1)

您已经嵌套了标题,这就是为什么我建议您在行的底部垂直对齐标题的原因。

请尝试添加

.react-bs-table th {
    vertical-align: bottom;
}

请记住,也许您必须添加!important才能应用它。