Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

allow html rendering in cells #248

Closed
sdementen opened this issue Nov 20, 2018 · 4 comments
Closed

allow html rendering in cells #248

sdementen opened this issue Nov 20, 2018 · 4 comments
Labels
dash-type-enhancement New feature or request

Comments

@sdementen
Copy link

I am desperately trying to add a line break (
) in a cell to display two strings one below the other in a cell.
I have read about the issue #222 where chriddyp adds some perspective to the issue (different renderer, editing cells, etc).
However, for my basic use case, is there some temporary "hack" allowing to add a
(and other simple html rendering like bold, ...) ? could I do it through css ? I also tried with a Div(["text1", Br(), "text2"]) but without success.

@pmajmudar
Copy link

Hey @sdementen - we had a similar issue - we wanted line breaks in text field.

I used CSS to 'hack' this, if your data has line breaks in, then you can style with:

style_data={'whiteSpace': 'pre-line'}

the pre-line respects line breaks it seems.

@sdementen
Copy link
Author

sdementen commented Nov 20, 2018

works great! tx @pmajmudar
for the record, the cell needs to contain \n and not <br> for line breaks

@Marc-Andre-Rivet
Copy link
Contributor

@sdementen We indeed don't currently support textarea (for explicit multiline) or html content but it is something we have discussed. Linking to the data types epic #166.

@Marc-Andre-Rivet
Copy link
Contributor

Marc-Andre-Rivet commented Jan 24, 2020

Markdown support was added in Dash v1.8.0 and should support most html use-cases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dash-type-enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants