Hi,
I am having issues with Streamlit rending CSS codes. I have the following for the CSS.
style =(
[{'selector': 'th.blank',
'props': [('background', '#7CAE00'),('color', 'white')]},
{'selector': 'th.index_name',
'props': [('background', '#7CAE00'),('color', 'white'),('font-family', 'verdana'),('text-align', 'center')]},
{'selector': 'th.col_heading',
'props': [('background', '#7CAE00'),('color', 'white'),('font-family', 'verdana'),('text-align', 'center')]},
{'selector': 'th.row_heading',
'props': [('background', '#7CAE00'),('color', 'white'),('vertical-align','top'),('font-family', 'verdana'),('text-align', 'center'),('width', '160px'), ('height', '35px')]},
{'selector': 'th.row_heading.level1',
'props': [('background', '#7CAE00'),('color', 'white'),('font-family', 'verdana'),('vertical-align','middle'),('text-align', 'center'),('width', '160px'), ('height', '35px')]},
{'selector': 'th.row_heading.level2',
'props': [('background', '#7CAE00'),('color', 'white'),('font-family', 'verdana'),('vertical-align','middle'),('text-align', 'center'),('width', '160px'), ('height', '35px')]},
{'selector': 'td',
'props': [('font-family', 'verdana'),('font-size', '2px'), ('color', 'black'),('text-align','right')]},
# {'selector': 'td.data',
# 'props': [('font-family', 'verdana'),('font-size', '2px'), ('color', 'black'),('text-align','right')]},
{'selector': 'tr:nth-of-type(odd)',
'props': [('background', '#DCDCDC')]},
{'selector': 'tr:nth-of-type(even)',
'props': [('background', 'white')]},
{'selector': 'tr:hover',
'props': [('background-color', 'yellow')]}
])
and the following instruction to display the table
st.markdown(df1.style.set_table_styles(style).to_html(),unsafe_allow_html=True)
Most of the tag are displaying correctly except the , it is showing dashes and not data, I tried to use ‘td.data’ also but di not work.
This code work in native python .
Any suggestion?
Best Regards