# DataTable goes blank when using bootstrap (dbc) themes

**URL:** <https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922>\
**Category:** Dash Python\
**Created:** [September 15, 2020, 3:29pm UTC](https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922 "2020-09-15T15:29:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![baadal](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@baadal](https://community.plotly.com/u/baadal)\
**Post date:** [September 15, 2020, 3:29pm UTC](https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922/1 "2020-09-15T15:29:43Z")

</div>

Hi,

I tried to setup a filterable table following the example code given in the documentation.  
[https://dash.plotly.com/datatable/callbacks](https://dash.plotly.com/datatable/callbacks)  
The _ **Backend Paging with Filtering and Multi-Column Sorting** _ one.

It works fine.

However, when I change to use a bootstrap theme:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/7/75203465f6e276112dc1d26f36a1d197acd0ecc4.png)

The font in the table becomes white/invisible:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/2/2225c75253ae7652bb47b490901bbaa169bbd038.png)

The data is still there. As it is visible when I select a cell:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/6/6ee19ce8ed79d4b8bead509ef270b5964b841330.png)

How can I use the data table element in a DBC themed setup?  
What needs to be done to get the table to be formatted as a DBC table?

Thank you.  
Baadal

---

<div class="post-metadata">

**Author:** ![tcbegley](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@tcbegley](https://community.plotly.com/u/tcbegley)\
**Post date:** [September 16, 2020, 6:42am UTC](https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922/2 "2020-09-16T06:42:09Z")

</div>

The problem appears to be that you’re using a dark Bootswatch theme, which sets the font color to white (or something close to it), but doesn’t have any effect on the cell backgrounds.

The easiest thing to do is to use a light theme. If you want to use the dark theme you’re going to have to manually style the datatable, i.e. use the inspector in the browser to find out which classes etc. are being used to set the cell colors and try to override it.

---

<div class="post-metadata">

**Author:** ![baadal](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@baadal](https://community.plotly.com/u/baadal)\
**Post date:** [September 16, 2020, 1:35pm UTC](https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922/3 "2020-09-16T13:35:00Z")

</div>

Thank you! That was it!

---

<div class="post-metadata">

**Author:** ![baadal](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@baadal](https://community.plotly.com/u/baadal)\
**Post date:** [September 23, 2020, 5:56am UTC](https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922/4 "2020-09-23T05:56:04Z")

</div>

Hi @tcbegley,

One follow up question.

One of the columns in the table was too wide and was making the table go out of the visible area.  
So I fixed the table size with a horizontal scroll bar using the overflowX.

Here is the code snippet:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/9/9a55578b275bd1f153c5575304891c0c67412c66.png)

Everything seems ok, except for the select column on the left. Only half of it is showing up:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/5/59d0f61d33bc31ff9f9da544e9fbc18f91b35881.png)

Do you know of any way to show it completely?  
Or to achieve a similar layout in other ways?

Thank you again!  
Baadal

---

<div class="post-metadata">

**Author:** ![tcbegley](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@tcbegley](https://community.plotly.com/u/tcbegley)\
**Post date:** [September 23, 2020, 6:28am UTC](https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922/5 "2020-09-23T06:28:50Z")

</div>

Hey @baadal

The problem is likely that dash-table and Bootstrap both use a CSS class called `row` and they clash. Try adding the following CSS to a file in your `assets/` folder. It will override the properties of the Bootstrap row within the table.

```css
.dash-table-container .row {
  display: block;
  margin: 0;
}

```

See [here](https://dash.plotly.com/external-resources) for more details about adding custom CSS if you’re unfamiliar.

---

<div class="post-metadata">

**Author:** ![baadal](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@baadal](https://community.plotly.com/u/baadal)\
**Post date:** [September 23, 2020, 1:18pm UTC](https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922/6 "2020-09-23T13:18:11Z")

</div>

Thanks a ton! That worked!

I am not a web developer by trade.  
Would you suggest any relevant topics and resources to begin to understand these moving parts?

Regards,  
Baadal

---

<div class="post-metadata">

**Author:** ![tcbegley](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@tcbegley](https://community.plotly.com/u/tcbegley)\
**Post date:** [September 23, 2020, 1:34pm UTC](https://community.plotly.com/t/datatable-goes-blank-when-using-bootstrap-dbc-themes/44922/7 "2020-09-23T13:34:25Z")

</div>

MDN has great resources such as [this introduction to HTML](https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started) and [this introduction to CSS](https://developer.mozilla.org/en-US/docs/Learn/CSS) are both well worth reading.

In addition to that, I often find it useful to use the developer tools in my browser to inspect what is actually getting rendered by the browser, making edits / changes there, then trying to figure out how I could have made that change happen from within my Dash app. Check out [this intro](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools) to using the developer tools to get up to speed quickly.
