Skip to content

Commit

Permalink
fix column width when stats are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
FreyaVF authored and Freyavf committed Jul 30, 2024
1 parent 99ee8bf commit 9d64039
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ def write_stats_xls(players, top_players, stat, xls_output_filename, config):

# adjust the width of the columns
for col in sheet.columns:
length = max(len(str(cell.value)) for cell in col[4:])
sheet.column_dimensions[col[0].column_letter].width = max(length+3, 12)
length = max((len(str(cell.value)) for cell in col[4:]), default = 9)
sheet.column_dimensions[col[0].column_letter].width = length + 3
for cell in col:
cell.alignment = cell.alignment.copy(horizontal="left")

Expand Down

0 comments on commit 9d64039

Please sign in to comment.