Table of media (pictures or audio)

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

2 Likes

That’s perfect thanks. I got that working.

1 Like