James McCool commited on
Commit
b68306e
·
1 Parent(s): 42ceb38

Enhance DataFrame styling with advanced formatting and centered alignment

Browse files

- Add precision formatting to DataFrame display
- Implement centered text alignment for table headers and cells
- Increase header font size for improved readability
- Apply bold styling to table cell data

Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -191,7 +191,12 @@ with tab1:
191
  st.dataframe(display.style
192
  .background_gradient(axis=0)
193
  .background_gradient(cmap='RdYlGn')
194
- .set_properties(color="white", align="left"), height=750, use_container_width = True)
 
 
 
 
 
195
  elif view_var == "Advanced":
196
  display = display
197
  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=False), height=750, use_container_width = True)
200
  elif view_var == "Advanced":
201
  display = display
202
  display = display.set_index('Player')