How can I modify the font size of a st.expander label?
expander = st.expander(label="Targets: ", expanded=True)
with expander:
st.markdown("""
How can I modify the font size of a st.expander label?
expander = st.expander(label="Targets: ", expanded=True)
with expander:
st.markdown("""
Hi @doug2023 , see if you can use the logic from here for your purpose:
Cheers
Would be the var htmlstr used for change the st.expander label font size? Iām sorry but I donāt understand!
JS code is created and stored in the htmlstr variable. It is then fed into components.html to be run.
The JS code iterates through the document elements to search for the one which has the label that matches the text you pass as a function parameter, and then changes its font size.
Hope this is understandable.
Cheers
Blockquote
Amazing!!! It really worked!
I donāt want to abuse your generosity, but is this script used to change the size of the wigdet, in this case the expander or something similar? And Iām new coding. Iāve been learning and testing. And I really liked Streamlit for show data analysis.
Hi @doug2023,
For most widgets, the above code could work. For others, you could try the logic from one of my previous responses:
Give it a shot and try and figure it out - thatās how I learnt.
Cheers
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
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.
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.
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.
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.