Can you select rows in a table?

Is it possible to select rows of a table and then get the selected data? Can be st.table() or st.write(dataframe)

1 Like

Hi @gaboc4. Unfortunately that functionality is not yet supported but we are designing it! In the meantime, a workaround would be to use an st.multiselect, e.g.:

selected_indices = st.multiselect('Select rows:', data.index)

Which will work up to about 1000 rows or so and which will look like this:

You can see an example in this gist.

This feature request is being tracked here. Please feel free to follow the issue to keep up with the latest developments. Also please feel free to comment on it so that we can better understand your use-case.

Thanks for using Streamlit!!

4 Likes

Thanks so much @Amanda_Kelly ! This answered exactly what I needed it to - and I will keep up to date with the ticket

1 Like

This is really great. :slight_smile:

Any news on this functionality? Currently Iโ€™m managing by using streamlit-aggrid, but would much prefer using the native streamlit dataframes if this functionality becomes available. @kantuni I can see that you are doing a lot of work around dataframes and arrow - any plans to also include the possibility to select rows? :slight_smile:

Best,
Peter

2 Likes

yeah, any news?

We just started development on this, expect some news over the next few months :wink:

5 Likes

Any updates? This seems like a very useful feature.

It will be really helpful if we have the option to select few rows from a large dataframe or a table. Any update on this?

Hi @Kiran_K, you can use aggrid to select multiple rows in a data frame. There should be examples of this on this forum or on Pabloโ€™s site.

However, you will need to wait if you want the feature to be available natively in Streamlit. Please check the roadmap for tentative dates.

Cheers

Thanks Shawn. But I couldnโ€™t find few of the native st.dataframe features like displaying all the content of a cell while clicking it in Aggrid. This feature is very handy, especially when the cell content is too long. Just like this

Yes we can resize the column width using Aggrid. But when the cell content has multiple lines of data, this process become really cumbersome. Is there any way to do the same in Aggrid. Please help!

@Kiran_K , were you ever able to figure out how to do this in AgGrid? I need to be able to do the same thing. Select rows which requires AgGrid and I need to be able to display the content of a cell when itโ€™s too long.

@sfc-gh-cconner , I have achieved it through this. Please check the below 2 links.

1 Like