Hide Toggle Columns Button

Is it possible to hide the Toggle Columns button? I need to hide columns to save real estate and have no intentions of displaying them.

1 Like

If you don’t need the user to be able to control this at all, can you just omit those columns from the columns prop? There’s no problem having extra fields in data that aren’t present in columns, these fields will just be ignored.

Otherwise there’s a hacky solution I can think of: hide it with css. The button has class show-hide, so using the table’s css prop:
css=[{"selector": ".show-hide", "rule": "display: none"}]

7 Likes

Thank you. The css worked perfectly!

I definitely also have this use case, so am now using this CSS.

Well, simply leaving out the column in columns but keeping it in data was the solution for me, thanks!

You can also put the following code in your style.css file in the assets folder of your dash app:

.show-hide {
    display: none;
}
1 Like