Browse Source

Merge branch 'master' of https://github.com/nguyenthenguyen/xlsx into nguyenthenguyen-master

Geoffrey J. Teale 10 năm trước cách đây
mục cha
commit
8da05f8a3c
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      xmlStyle.go

+ 6 - 0
xmlStyle.go

@@ -865,6 +865,12 @@ func (alignment *xlsxAlignment) Equals(other xlsxAlignment) bool {
 }
 
 func (alignment *xlsxAlignment) Marshal() (result string, err error) {
+	if alignment.Horizontal == "" {
+		alignment.Horizontal = "general"
+	}
+	if alignment.Vertical == "" {
+		alignment.Vertical = "bottom"
+	}
 	result = fmt.Sprintf(`<alignment horizontal="%s" indent="%d" shrinkToFit="%b" textRotation="%d" vertical="%s" wrapText="%b"/>`, alignment.Horizontal, alignment.Indent, bool2Int(alignment.ShrinkToFit), alignment.TextRotation, alignment.Vertical, bool2Int(alignment.WrapText))
 	return
 }