I am a newbie for Streamlit. Therefore, I’m sorry if the question is dumb.
However, I’m trying to build an app (called Landed Cost) that is going to calculate Export Costs from the Exporter Country to the Importer Country. To do that, I need to get the product & address information from the user. I’ve divided the inputs as below:
Even if I have distributed product information to the 2 columns, the columns have not been distributed to the entire screen. Also, I want to use the remaining part of the screen by getting address information from the user.
How can I solve it? I tried adding new and will-not-be-used columns and decreased their relative width. However, when I do that the product information (left) side gets narrowed and I do not want to see them as narrowed. I also tried to use nested columns in my system but the system threw the error.
The area that I want to use (without narrowing the left side) is as below:
I’ve added it already. That did not help. There is also the upper side of my Streamlit page, which is below, and that suits my requirements. But, I can’t do it for the Productt & Adress Information side.
In addition to the amazing code snippet provided by @Shawn_Pereira, if you’d like to add some white space, you can add additional columns to serve as white space. Afterwards, you can adjust the width of each columns (as they don’t need to have the same width, but at default the width of all columns are of the same width).
col = st.columns((3, 1, 3))
with col[0]:
...statements goes here...
with col[1]:
...this is the white space...
with col[2]:
...statements goes here...
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.