How can I make colored borders of specified thickness appear around containers? E.g.
secondrow1, secondrow2, secondrow3, secondrow4 = st.columns([3,2,4,4])
secondrow1title = "**" + 'Public domain books in progress:** (' + str(len(public_domain_files)) + ')'
secondrow1.markdown(secondrow1title)
with secondrow1.container(): # I want a border around this container
with st.form(key="PublicDomainBooks"):
selected_file = secondrow1.selectbox("Select a file to work on:", public_domain_files)
submitted = st.form_submit_button("Work on this file")
if submitted:
run_this_file = os.path.join(public_domain_path, selected_file)
subprocess.call(['open',run_this_file])
with secondrow2.container(): # I want a border around this container
with st.form("Contracted Titles In Progress"):
st.markdown("**Royaltied Titles With Duty to Publish:**")
contracted_files = get_filenames(contracted_path)
selected_file = st.selectbox("Select a file to work on:", contracted_files)
submitted = st.form_submit_button("Work on this file")
if submitted:
run_this_file = os.path.join(public_domain_path, selected_file)
subprocess.call(['open',run_this_file])
If you go into dev tools in the browser you can identify the CSS class and then use st.markdown() to inject it into the dashboard.
The issue comes from the fact that a lot of the time the css selectors are not specific enough and so its hard to apply styling to one individual element.
@fredzannarbor Can you show me a screenshot or sketch of what you’d ideally want? Then I can add this to our feature requests, so we can see if and how we can best support this.
Hi! I think the idea is the one on the following link:
Now, I´m using st.expander (opened by default) that could mimic a card, with borders and you can include an element like a chart or image, …
The idea is to have the same functionality as the one created as a custom component but without the problems involved in creating a new custom component like using react, js, etc. and organize the cards as containers.
I just wanted to keep this open and add +1 since this is something I’m looking for too
Basically, it’d be nice to be able to put a border/box around a set of info on a page to make it look nicer
In my case this is similar to using PPT and either a) inserting a text box and giving it borders or b) putting a square with no fill around a set of info
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.