Need Help with Streamlit Table Checkbox Display

Hi everyone,

I’m currently working on a Streamlit application where I’m displaying data in a table format. I’ve noticed that when I use the st.dataframe() function to display the data, the boolean values are shown as checkboxes, like this:

However, when I use the st.table() function to display the same data, the boolean values are displayed like this:

Is there any way to display boolean values as checkboxes using st.table()? I prefer the visual display of the checkboxes as it’s more intuitive for the user.

Thank you in advance for your help!

Hey @ttuz,

Thanks for posting!

As far as I know, checkboxes only work with st.dataframe() and not with st.table().

I’m including @lukasmasuch, who supervised the development of our latest st.dataframe() widget and could definitely confirm this. He might even have a hack or two up his sleeve! :wink:

Best wishes,
Charly

3 Likes

Unfortunately, I don’t know about any workaround for st.table to add checkboxes :frowning:

I replied in your other thread with an option:

1 Like

Thanks !

You can use emojis too.

true1 = "☑"
false1 = "☐"

true2 = "☑️"
false2 = "⬜️"

data = pd.Series([True, False])
st.table(data.replace({False: false1, True: true1}))
st.table(data.replace({False: false2, True: true2}))
2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.