This repository has been archived on 2025-03-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
boilerplate/internal/extras/excel/styles.go
2025-03-11 21:13:45 +07:00

53 lines
917 B
Go

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)
}