Set Style:
Package Mainimport ("github.com/tealeg/xlsx" "FMT") Func main () {varFile *xlsx. FilevarSheet *xlsx. SheetvarRow *xlsx. RowvarCell *xlsx. CellvarErr Error Style:=xlsx. NewStyle () Fill:= *xlsx. Newfill ("Solid","00ff0000","FF000000") Font:= *xlsx. NewFont ( -,"Verdana") Border:= *xlsx. Newborder ("Thin","Thin","Thin","Thin") style. Fill=fill style. Font=font style. Border=border style. Applyfill=truestyle. Applyfont=truestyle. Applyborder=truefile=xlsx. NewFile () sheet,_= file. Addsheet ("SheetName") Row=sheet. AddRow () cell=row. Addcell () cell. Value="100000"cell. SetStyle (style) cell=row. Addcell () cell. Value="Test"Err= file. Save ("test.xlsx") ifErr! =Nil {fmt. Printf (Err. Error ())}}
Send to Browser: https://blog.csdn.net/niechaoya/article/details/46470715
Idea: First organize the data into a two-dimensional array [[UA UA UA (UB), "[[]] Swith