feat: excel data style

This commit is contained in:
2025-03-11 21:13:45 +07:00
parent ccfa27deff
commit 13f3e5bf29
11 changed files with 565 additions and 36 deletions

View File

@@ -0,0 +1,52 @@
package excel
import "github.com/xuri/excelize/v2"
func LoadHeadersStyle(file *excelize.File) (int, error) {
headersStyle := excelize.Style{
Alignment: &excelize.Alignment{
Horizontal: "center",
Vertical: "center",
},
Border: []excelize.Border{
{
Type: "left",
Color: "000000",
Style: 1,
},
{
Type: "right",
Color: "000000",
Style: 1,
},
{
Type: "top",
Color: "000000",
Style: 1,
},
{
Type: "bottom",
Color: "000000",
Style: 1,
},
},
Font: &excelize.Font{
Bold: true,
VertAlign: "center",
},
}
return GetStyleId(file, &headersStyle)
}
func LoadDataStyle(file *excelize.File) (int, error) {
dataStyle := excelize.Style{
Alignment: &excelize.Alignment{
Horizontal: "center",
Vertical: "center",
},
Font: &excelize.Font{
VertAlign: "center",
},
}
return GetStyleId(file, &dataStyle)
}