Is there a way to completely remove the upper area of space above the tabs? So that my tabs are on the same level as the sidebar expand/collapse arrow? This area above is effectively “dead-space” I would like to utilise.
I can get close with .block-container {padding-top: 3rem}; , but anything < 3rem begins to crop the text and still has a lot of space above.
Please find example code and a screenshot highlighting the issue below:
import streamlit as st
st.set_page_config(layout = "wide")
st.sidebar.title("Example")
st.sidebar.write(f"Please rate your skillset level:")
slider_options = ["None", "Limited", "Moderate", "Good", "Excellent"]
analysis_rating = st.sidebar.select_slider(label = "Data Analysis", options = slider_options, value = "Moderate")
ml_rating = st.sidebar.select_slider(label = "Machine Learning", options = slider_options, value = "Moderate")
coding_rating = st.sidebar.select_slider(label = "Coding", options = slider_options, value = "Moderate")
tab1, tab2 = st.tabs(["\u2001" * 8 + x for x in ["Example Tab 1", "Example Tab 2"]])
st.markdown(f'''
<style>
.block-container {{padding-top: 3rem; padding-bottom: 0rem; padding-left: 1rem; padding-right: 1rem; overflow: hidden}}
</style>''', unsafe_allow_html = True)