This commit is contained in:
2025-10-26 18:09:50 +01:00
parent bdac177353
commit 6cdfd4a1e6

View File

@@ -142,6 +142,18 @@ with pd.ExcelWriter(xlsx_path, engine="openpyxl") as writer:
)
elif isinstance(cell.value, str) and "\n" in cell.value:
cell.alignment = Alignment(wrap_text=True, vertical="top")
# ----- Force wrap_text for the entire DEKURS column -----
for col in ws.columns:
header = col[0].value
if header and "DEKURS" in str(header).upper():
for cell in col[1:]: # skip header row
# preserve existing alignment if possible
align = cell.alignment
cell.alignment = Alignment(
horizontal=align.horizontal or "left",
vertical="top",
wrap_text=True
)
# ----- Column widths -----
for col in ws.columns: