已验证 提交 961996a8 编写于 作者: xurime's avatar xurime

- Fix `completeCol()` make extra rows, relate issue #87;

- godoc updated
上级 4a74951e
......@@ -277,13 +277,6 @@ func (f *File) RemoveCol(sheet, column string) {
// Completion column element tags of XML in a sheet.
func completeCol(xlsx *xlsxWorksheet, row, cell int) {
if len(xlsx.SheetData.Row) < cell {
for i := len(xlsx.SheetData.Row); i < cell; i++ {
xlsx.SheetData.Row = append(xlsx.SheetData.Row, xlsxRow{
R: i + 1,
})
}
}
buffer := bytes.Buffer{}
for k, v := range xlsx.SheetData.Row {
if len(v.C) < cell {
......
......@@ -1796,9 +1796,14 @@ func parseFormatStyleSet(style string) (*formatCellStyle, error) {
// 634 | ZWR
//
// Excelize support set custom number format for cell. For example, set number
// as date type in Uruguay (Spanish) format:
// as date type in Uruguay (Spanish) format for Sheet1!A6:
//
// xlsx.NewStyle(`{"custom_number_format": "[$-380A]dddd\\,\\ dd\" de \"mmmm\" de \"yyyy;@"}`)
// xlsx := excelize.NewFile()
// xlsx.SetCellValue("Sheet1", "A6", 42920.5)
// style, _ := xlsx.NewStyle(`{"custom_number_format": "[$-380A]dddd\\,\\ dd\" de \"mmmm\" de \"yyyy;@"}`)
// xlsx.SetCellStyle("Sheet1", "A6", "A6", style)
//
// Cell Sheet1!A6 in the Excel Application: martes, 04 de Julio de 2017
//
func (f *File) NewStyle(style string) (int, error) {
var cellXfsID int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册