Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Cannot change the max-width on Table

I have a table with a column which has a very long string (10000+ characters).

When I create a table with html.Table, that column scales horizontally so much that the scroller seems very small.

Is there a way to make the column scale vertically ? Or change the font of the table ?

Thank you.

You’ll need to use CSS in your table headers. For example, try using the text-overflow property (https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow) like

html.Th(very_long_string, style={'textOverflow': 'ellipsis'})

Thanks. It works.

I’m trying the dash_table_experiments due to its flexibility and filter features. And it also has problems with strings that are too long.

I tried adding “
” or “\n” in the text of the cells when the length of a row reaches a number, but it doesn’t work.

Are there any ways to enable word-wrap on dash_table_experiments, or make the cell scale vertically in the table, or may be I can make a workaround by adding some kind of next-line characters ?

Thank you in advance.

This isn’t possible right now but it will be once this component supports rendering HTML components as it’s cells. You can track the progress of this feature in https://github.com/plotly/dash-table-experiments/pull/11

It would be great.
Thank you.