Skip to content

Instantly share code, notes, and snippets.

@mafredri mafredri/main.go
Created Feb 13, 2016

Embed
What would you like to do?
tealeg/xlsx PR #149 breaking change demonstration
package main
import "github.com/tealeg/xlsx"
func main() {
file := xlsx.NewFile()
sheet, err := file.AddSheet("Sheet1")
if err != nil {
panic(err.Error())
}
row := sheet.AddRow()
cell := row.AddCell()
cell.Merge(1, 0)
style := cell.GetStyle()
style.Border.Top = "medium"
style.Border.Bottom = "medium"
style.Border.Left = "medium"
style.ApplyBorder = true
cell = row.AddCell()
style = cell.GetStyle()
style.Border.Top = "medium"
style.Border.Bottom = "medium"
style.Border.Right = "medium"
style.ApplyBorder = true
err = file.Save("./foo.xlsx")
if err != nil {
panic(err.Error())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.