This repository was archived by the owner on Aug 29, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 72
Table of images or thumbnails please ?? #800
Copy link
Copy link
Closed
Description
I don't know if this is what you are looking for but I managed to put the images in a table (bootstrap component) through a workaround.
Through the following function I transformed them into thumbnails and then wrote them in html components.
def get_thumbnail(path):
i = Image.open(path)
i.thumbnail((100, 100), Image.LANCZOS)
buff = BytesIO()
i.save(buff, format="PNG")
encoded_image = base64.b64encode(buff.getvalue()).decode('UTF-8')
return (html.Img(src='data:image/png;base64,{}'.format(encoded_image)))
At this point I put them in a column of a pandas dataframe in the layout.
html.Div([
dbc.Table.from_dataframe(pandas_df, striped=True, bordered=True, hover=True, responsive="sm")
],
style = {'margin-right':'90px','margin-left':'90px'})
P.S.
import dash_html_components as html
import dash_bootstrap_components as dbc`
Originally posted by @ricky1192 in #383 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels