CSS styling does not work with ToolkitProvider
See original GitHub issueWhen I use ToolkitProvider, table styling does not work at all. I specified “striped” and “bordered”, but it doesn’t work. I tried applying my own custom rowStyle as well, but it doesn’t work. It’s as if the CSS doesn’t exist. Search bar styling does not work either. Here is my code:
import React, { Component } from 'react'
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css'
import 'react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min.css'
import dataArr from './data/dataArr'
import ToolkitProvider, { Search } from 'react-bootstrap-table2-toolkit'
import BootstrapTable from 'react-bootstrap-table-next'
import paginationFactory from 'react-bootstrap-table2-paginator'
class IndexTable extends Component {
constructor (props) {
super(props)
this.state = {
data: dataArr
}
this.formatImage = this.formatImage.bind(this)
}
...
...
...
render () {
const { SearchBar } = Search
const columns = [ ....... ]
...
...
return (
<div>
<ToolkitProvider
keyField="id"
data={this.state.data}
columns={columns}
bootstrap4
striped
bordered
search
>
{
props => (
<div>
<SearchBar {...props.searchProps}
placeholder="Search..."
/>
<hr />
<BootstrapTable pagination={paginationFactory()} { ...props.baseProps } />
<br />
</div>
)
}
</ToolkitProvider>
</div>
)
}
}
I’m running versions: react-bootstrap-table-next: 1.4.1 react-bootstrap-table2-paginator: 1.0.4 react-bootstrap-table2-toolkit: 1.1.1
Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
React ToolkitProvider BootstrapTable4 - css - Stack Overflow
I assume that basic style will be applied to header row, and data rows (padding, margin, font-size and font-family as examples).
Read more >CSS @media Rule - W3Schools
The @media rule is used in media queries to apply different styles for different media types/devices. Media queries can be used to check...
Read more >Columns Props · react-bootstrap-table2
A new Object will be the result of element style. column.headerStyle - [Object | Function]. It's available to have customized inline-style on table...
Read more >@ounai/react-bootstrap-table2-toolkit - npm
ToolkitProvider is a wrapper of react context, you are supposed to wrap the BootstrapTable and SearchBar as the child of ToolkitProvider.
Read more >react-bootstrap-table-next - basic example - CodeSandbox
react-bootstrap-table-next - basic example. brohera. 602. 0. 3. Edit Sandbox. Files. public. src. index.js. styles.css. package.json. Dependencies.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I tried it that way but it didn’t work. What I ended up doing is adding “import ‘bootstrap/dist/css/bootstrap.css’” before the table2 CSS. Now it appears to work. Thanks!
On Tue, Nov 13, 2018 at 4:38 PM Yassien notifications@github.com wrote:
Have this or kinda alike issue on Export CSV btn:
UPD: Probably not a bug, fixed by adding
className="btn-success"