Hi, I am trying to use Dash datatable to render an expandable/collapsible list of image links with a click.
I am trying to use the <details>
and <summary>
tags to achieve this. Are they supported by Dash datatable?
Are there alternatives?
vs code rendered the markdown with no problem:
but dash datatable didn’t render the markdowm correctly:
import dash
import dash_table
import pandas as pd
app = dash.Dash(__name__)
imgs = '''
<details>
<summary>Images</summary>
- [img 0](https://via.placeholder.com/150)
- [img 1](https://via.placeholder.com/250)
- [img 2](https://via.placeholder.com/350)
</details>'''.strip()
app.layout = dash_table.DataTable(
id='table',
columns=[{"name": 'images', "id": 'images', 'type': 'text', "presentation": "markdown"}],
data=[{'images': imgs}],
style_cell={
'textAlign': 'left',
'textOverflow': 'ellipsis',
'maxWidth': 0
}
)
if __name__ == '__main__':
app.run_server(debug=True)