Is it possible to embed media into a table in steamlit?
Is activating html a work around?
Is it possible to embed media into a table in steamlit?
Is activating html a work around?
Hey @29f3j092j3f0j
Yes you can absolutely embed media into your streamlit app. In fact with then new st.beta_columns()
function in streamlit you can make a table of columns on your page and put media in each of the cells of your table!
import streamlit as st
st.title('Table of media')
# to get different images/media in the rows and columns, have a systematic
# way to label your images/media. For mine, I have used row_{i}_col_0/1
# also note that different media types such as an audio or video file you
# will need to have that whole column as an audio or video column!
for i in range(1,3): # number of rows in your table! = 2
cols = st.beta_columns(2) # number of columns in each row! = 2
# first column of the ith row
cols[0].image('row_%i_col_0.png' %i, use_column_width=True)
cols[1].image('row_%i_col_1.jpg' %i, use_column_width=True)
That looks like this:
Hope this is helpful,
Happy Streamlit-ing!
Marisa
That’s perfect thanks. I got that working.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.