From 4f0d676eb765472d1fe7a29cacd165b982785bd2 Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 8 Jul 2021 00:52:07 +0800 Subject: Fix missing set each cell's styles when set columns style --- col.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'col.go') diff --git a/col.go b/col.go index 91ca3da..5171f34 100644 --- a/col.go +++ b/col.go @@ -435,6 +435,13 @@ func (f *File) SetColStyle(sheet, columns string, styleID int) error { fc.Width = c.Width return fc }) + if rows := len(ws.SheetData.Row); rows > 0 { + for col := start; col <= end; col++ { + from, _ := CoordinatesToCellName(col, 1) + to, _ := CoordinatesToCellName(col, rows) + f.SetCellStyle(sheet, from, to, styleID) + } + } return nil } -- cgit v1.2.1