I am using a st.markdown
to display custom color for the multiselect
tags. However, I noticed that I have extra whitespace created(vertical) between two multiselect
options. below is the code I am using.
import streamlit as st
st.set_page_config(layout="wide", page_title="Police Report Triaging")
st.subheader("Key information")
col3, col4 = st.columns([0.5,2.5])
person_list = ['Victim','Accused','Suspect','Witness']
for person in person_list:
st.markdown(
f"""
<style>
span[data-baseweb="tag"]:has(span[title="{person}"]) {{
background-color: #1E90FF !important;
}}
</style>
""",
unsafe_allow_html=True,
)
with col3:
st.multiselect(
label="Person",
default = ["Victim"],
options= person_list
)
with col4:
st.markdown('#')
st.write("**Name**: Samuel")
col5, col6 = st.columns([0.5,2.5])
with col5:
st.multiselect(
label="Person",
default = ["Accused"],
options= person_list
)
with col6:
st.markdown('#')
st.write("**Name**: Bob")