experimented with changing column headers
Browse files
app.py
CHANGED
|
@@ -64,12 +64,35 @@ positive_vals, negative_vals = get_input_values(positive_and_negative_indices, e
|
|
| 64 |
|
| 65 |
# Create a function to generate a table
|
| 66 |
def create_table(texts, values, title):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
df = pd.DataFrame({"Feature Explanation": texts, 'Value': values})
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
st.dataframe(df, hide_index=True) # Display a simple table
|
|
|
|
| 70 |
|
| 71 |
# Arrange tables horizontally using Streamlit columns
|
| 72 |
-
col1, col2 = st.columns(2)
|
| 73 |
|
| 74 |
# Display tables in Streamlit columns
|
| 75 |
with col1:
|
|
|
|
| 64 |
|
| 65 |
# Create a function to generate a table
|
| 66 |
def create_table(texts, values, title):
|
| 67 |
+
# TODO: change color dataframe header -> tried many different options but none worked see below
|
| 68 |
+
# header_style = '''
|
| 69 |
+
# <style>
|
| 70 |
+
# th{
|
| 71 |
+
# background-color: #00052D;
|
| 72 |
+
# }
|
| 73 |
+
# </style>
|
| 74 |
+
# '''
|
| 75 |
df = pd.DataFrame({"Feature Explanation": texts, 'Value': values})
|
| 76 |
+
# df = df.style.set_properties(**{
|
| 77 |
+
# 'selector': 'th',
|
| 78 |
+
# 'props': [
|
| 79 |
+
# ('background-color', 'black'),
|
| 80 |
+
# ('color', 'cyan')]
|
| 81 |
+
# })
|
| 82 |
+
# df = df.style.set_properties(**{'background-color': 'black',
|
| 83 |
+
# 'color': 'green'})
|
| 84 |
+
|
| 85 |
+
# headers = {
|
| 86 |
+
# 'selector': 'th',
|
| 87 |
+
# 'props': [('background-color', '#67c5a4')]#'background-color: #000066; color: white;'
|
| 88 |
+
# }
|
| 89 |
+
# df = df.style.set_table_styles([headers])
|
| 90 |
+
st.markdown(f'#### {title}') # Markdown for styling
|
| 91 |
st.dataframe(df, hide_index=True) # Display a simple table
|
| 92 |
+
# st.markdown(header_style, unsafe_allow_html=True)
|
| 93 |
|
| 94 |
# Arrange tables horizontally using Streamlit columns
|
| 95 |
+
col1, col2 = st.columns(2,gap="small")
|
| 96 |
|
| 97 |
# Display tables in Streamlit columns
|
| 98 |
with col1:
|