Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
·
fc87580
1
Parent(s):
9f7a12e
Simplify DataFrame styling and add custom CSS for column sizing
Browse files- Remove complex table styles from DataFrame rendering
- Reduce styling complexity while maintaining gradient coloring
- Add custom CSS to adjust first column font size
app.py
CHANGED
|
@@ -58,6 +58,10 @@ st.markdown("""
|
|
| 58 |
background-color: #DAA520;
|
| 59 |
cursor: pointer;
|
| 60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
</style>""", unsafe_allow_html=True)
|
| 62 |
|
| 63 |
@st.cache_resource(ttl = 60)
|
|
@@ -188,15 +192,7 @@ with tab1:
|
|
| 188 |
elif type_var == "Showdown":
|
| 189 |
display = display[['Player', 'Salary', 'Median', '5x%', 'Own']]
|
| 190 |
display = display.set_index('Player')
|
| 191 |
-
st.dataframe(display.style
|
| 192 |
-
.background_gradient(axis=0)
|
| 193 |
-
.background_gradient(cmap='RdYlGn')
|
| 194 |
-
.format(player_roo_format, precision=2)
|
| 195 |
-
.set_table_styles([
|
| 196 |
-
{'selector': 'th.col_heading', 'props': 'text-align: center;'},
|
| 197 |
-
{'selector': 'th.col_heading.level0', 'props': 'font-size: 1.5em;'},
|
| 198 |
-
{'selector': 'td', 'props': 'text-align: center; font-weight: bold;'},
|
| 199 |
-
], overwrite=True), height=750, use_container_width = True)
|
| 200 |
elif view_var == "Advanced":
|
| 201 |
display = display
|
| 202 |
display = display.set_index('Player')
|
|
|
|
| 58 |
background-color: #DAA520;
|
| 59 |
cursor: pointer;
|
| 60 |
}
|
| 61 |
+
|
| 62 |
+
[data-testid^="glide-cell-"][aria-colindex="1"] {
|
| 63 |
+
font-size: 2px !important;
|
| 64 |
+
}
|
| 65 |
</style>""", unsafe_allow_html=True)
|
| 66 |
|
| 67 |
@st.cache_resource(ttl = 60)
|
|
|
|
| 192 |
elif type_var == "Showdown":
|
| 193 |
display = display[['Player', 'Salary', 'Median', '5x%', 'Own']]
|
| 194 |
display = display.set_index('Player')
|
| 195 |
+
st.dataframe(display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(player_roo_format, precision=2), height=750, use_container_width = True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
elif view_var == "Advanced":
|
| 197 |
display = display
|
| 198 |
display = display.set_index('Player')
|