I have the similar use case that many seem to have posted – needing to be able to display a dataframe with text wrapped and then being able to select rows (similar to the way it is done with data_editor and the checkboxes). The text wrapping is critical for my case.
Does anyone have a solution for this? It seems like the only way to get the wrapping is via st.table, but I have not been able to find a way to retrieve the results of which rows were clicked. Has anyone implemented that via JavaScript?
Thanks so much for any help and sorry for the repeat! Please let me know if this is tracked somewhere.
So I couldn’t find any good solution to this and thought instead of creating a custom component maybe I could do it using a checkbox and a table, and then got to the point of using a checkbox, the cookie manager, and st.column.
Basic idea is that you use a variable to contain the indexes of the rows being selected, and the index is passed by the checkbox component to a function that updates the list of indexes checked. Then you can use this lookup into the dataframe!
The columns functionality seems to allow for word wrapping, the way that the HTML table does (I think you could use that, too). And maybe the st.container if you really want it to look like a table.
I think this probably does require some clearing of the caches.
Not sure if helpful to anyone because such an obscure use case not needing it in an actual table but figured I’d share!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
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.
Performance cookies
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.
Functional cookies
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.
Targeting cookies
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.