add some docs
This commit is contained in:
@@ -132,9 +132,10 @@ func main() {
|
||||
|
||||
// Set the style for the header values
|
||||
// Just handling bold for now but we can do other styles too as per https://xuri.me/excelize/en/style.html#NewStyle
|
||||
fmt.Printf("Bolding top row : %v\n", boldTopRow)
|
||||
headerStyle, err2 := xlsx.NewStyle(&excelize.Style{
|
||||
Font: &excelize.Font{
|
||||
Bold: boldTopRow,
|
||||
Bold: true,
|
||||
},
|
||||
})
|
||||
if err2 != nil {
|
||||
@@ -145,9 +146,11 @@ func main() {
|
||||
column = 1
|
||||
|
||||
// Set the style
|
||||
err = xlsx.SetRowStyle(worksheetName, row, row, headerStyle)
|
||||
if err != nil {
|
||||
fmt.Printf("Error setting header style : '%s'\n", err)
|
||||
if boldTopRow {
|
||||
err = xlsx.SetRowStyle(worksheetName, row, row, headerStyle)
|
||||
if err != nil {
|
||||
fmt.Printf("Error setting header style : '%s'\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Add the header row
|
||||
|
Reference in New Issue
Block a user