panel
panel copied to clipboard
Markdown Panels within Tabulator row_content never get line-wraped
This is kind of a nishe bug, how ever it is annoying me.
When you have a Markdown Panel (maybe other as well) within the row_content of a Tabulator, it's content does not get broken down if the lines are really long. For example in the screenshot: Above the tabulator, the long markdown panel gets line-wrapped. Having the same markdown within the tabulator row_content, it does not.
The code to reproduce this is:
import panel as pn
pn.extension("Tabulator")
import pandas as pd
short_markdown = """
This is no problem\n\n because manuel linebreaks work
"""
long_markdown = 'This is long and problematic: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.'
markdowns=[short_markdown, long_markdown]
elements = pd.DataFrame.from_dict({'name': {0: 'Hydrogen', 1: 'Helium' },
'atomic mass': {0: '1.00794', 1: '4.002602'}})
content_fn = lambda row: markdowns[row.name]
periodic_table = pn.widgets.Tabulator(
elements, height=350, width=500,
row_content=content_fn, embed_content=False
)
pn.Column(
long_markdown,
periodic_table)
Using panel-1.5.2