summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2017-07-27 15:38:58 +0800
committerRi Xu <xuri.me@gmail.com>2017-07-27 15:38:58 +0800
commit961996a8132eda8671d2de45fe21bfeb43866752 (patch)
tree18a39f7a1220b4a7e4d4401e1470e5c70d6c7616
parent4a74951e81c9b0c64b0ce9319e325a1f67c621c6 (diff)
- Fix `completeCol()` make extra rows, relate issue #87;
- godoc updated
-rw-r--r--col.go7
-rw-r--r--styles.go9
2 files changed, 7 insertions, 9 deletions
diff --git a/col.go b/col.go
index 00d7135..56fb6e8 100644
--- a/col.go
+++ b/col.go
@@ -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 {
diff --git a/styles.go b/styles.go
index 20e6593..2e440c2 100644
--- a/styles.go
+++ b/styles.go
@@ -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