add some docs

This commit is contained in:
2023-02-13 12:40:56 +11:00
parent 78ba74c709
commit 061bb83861
2 changed files with 16 additions and 7 deletions

View File

@@ -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