Skip to content

Commit 6079396

Browse files
authored
Merge pull request #493 from facultyai/update-faq
Update dash-table faqs
2 parents 7faedd8 + ae0fc77 commit 6079396

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

docs/content/docs/faq.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,6 @@ title: FAQ
66

77
This page contains various tips and tricks and answers to frequently asked questions about _dash-bootstrap-components_. If you think something is missing, please submit an [issue][issue] on the GitHub issue tracker.
88

9-
### Using Bootstrap and `dash_table.DataTable` together
10-
11-
Bootstrap CSS defines a CSS class called `row`, which is a key part of the Bootstrap grid system. The `DataTable` component applies the `row` class to rows in the table, which causes a clash and breaks some of the formatting of the table. In particular the table can overflow its container, and dropdowns aren't rendered correctly.
12-
13-
The solution is to prevent the Bootstrap row styles from being applied to rows in the table. There are two ways to do this. The first way, which is maybe more convenient if you just have a single table, is to pass additional arguments to the `css` prop of `DataTable` like this
14-
15-
```python
16-
DataTable(..., css=[{"selector": ".row", "rule": "margin: 0; display: block"}])
17-
```
18-
19-
Alternatively, you can write the following custom CSS to apply the styles to all tables in your app.
20-
21-
```css
22-
.dash-table-container .row {
23-
display: block;
24-
margin: 0;
25-
}
26-
```
27-
28-
See the [Dash docs](https://dash.plotly.com/external-resources) for details on linking custom stylesheets.
29-
309
### How do I use `Tooltip` or `Popover` with pattern-matching callbacks?
3110

3211
Dash 1.11.0 added support for [pattern matching callbacks](https://dash.plotly.com/pattern-matching-callbacks) which allows you to write callbacks that can update an arbitrary or dynamic number of Dash components. To enable this, the `id` of a Dash component can now be a Python dictionary, and the callback is triggered based on a matching rule with one or more of the keys in this dictionary.
@@ -112,4 +91,33 @@ Bootstrap sets the `max-width` of the popover in the `.popover` CSS class. You c
11291

11392
See the [Dash docs](https://dash.plotly.com/external-resources) for details on linking custom stylesheets.
11493

94+
### Using Bootstrap and `dash_table.DataTable` together
95+
96+
This is a historical problem that was fixed in Dash 1.18.1. If you are able to, the easiest fix to compatibility issues with `dash_table.DataTable` and _dash-bootstrap-components_ is to simply update Dash
97+
98+
```
99+
pip install -U dash
100+
```
101+
102+
If you have an older version of Dash and are unable to update, then read on for a workaround.
103+
104+
Bootstrap CSS defines a CSS class called `row`, which is a key part of the Bootstrap grid system. The `DataTable` component applies the `row` class to rows in the table, which causes a clash and breaks some of the formatting of the table. In particular the table can overflow its container, and dropdowns aren't rendered correctly.
105+
106+
The solution is to prevent the Bootstrap row styles from being applied to rows in the table. There are two ways to do this. The first way, which is maybe more convenient if you just have a single table, is to pass additional arguments to the `css` prop of `DataTable` like this
107+
108+
```python
109+
DataTable(..., css=[{"selector": ".row", "rule": "margin: 0; display: block"}])
110+
```
111+
112+
Alternatively, you can write the following custom CSS to apply the styles to all tables in your app.
113+
114+
```css
115+
.dash-table-container .row {
116+
display: block;
117+
margin: 0;
118+
}
119+
```
120+
121+
See the [Dash docs](https://dash.plotly.com/external-resources) for details on linking custom stylesheets.
122+
115123
[issue]: https://github.com/facultyai/dash-bootstrap-components/issues/new?template=feature.md

0 commit comments

Comments
 (0)