This creates 3 different sections in the final output page, and none of them are related to each other in any way. Is there a way to achieve what I am trying to do in streamlit?
I tired st.markdownas well, same problem.
What I am trying to do is
Option 1:
Start a div
Add a lot of streamlit components, like buttons, text boxes etc …
Close the div.
Option 2:
I have a table like structure with lot of columns and rows in a container.
I want to add a horizontal scroll bar into the overall container.
I need input boxes and buttons inside the table, hence I was told I can’t use dataframe.
You can’t create open-ended divs like that in Streamlit. Each Streamlit command is wrapped in its own div (even st.html) so incomplete, open HTML can’t span across commands.
st.data_editor let’s you have certain types of input, but yes, buttons are not supported. You can use a checkbox instead of a button, or build buttons on the outside of the dataframe.
I usually think of row selections and st.dataframe for some kind of row-by-row action.
If you just want to wrap a bunch of Streamlit components, use st.container.
Can you describe more specifically what you are trying to accomplish? As described above, you might need a custom component, but you might get away with some CSS hacking on the div from st.container.
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.