I’m putting together a dashboard using Dash on Databricks. For whatever reason, Dash doesn’t recognize common Python line breaks like \n. (If I try to use \n, those characters appear instead of causing a line break) I did find the pre-wrap option which works great on a multiline string for any time I know exactly how many rows I’m about to display. However, now I’m at point where I’m dealing with lists of varying lengths and I’m trying to find a way to display all the information in a single column as opposed to a row. Is there a way to achieve the desired output without knowing how many rows are in the list and without using common line break methods?
Displaying the content in a html.Pre
will render the line breaks. If you can parse the content into markdown format, you can use the dcc.Markdown
component which is a nice way to display a list. Depending on your data you could also use a table, dash-ag-grid
could work.
1 Like