mirror of
https://github.com/fumiama/go-docx.git
synced 2026-06-06 00:00:24 +08:00
fix table
This commit is contained in:
@@ -776,9 +776,9 @@ func (w *WTableBorders) UnmarshalXML(d *xml.Decoder, start xml.StartElement) err
|
||||
// WTableBorder is a structure representing a single border of a Word table.
|
||||
type WTableBorder struct {
|
||||
Val string `xml:"w:val,attr"`
|
||||
Size int `xml:"w:sz,attr"`
|
||||
Space int `xml:"w:space,attr"`
|
||||
Color string `xml:"w:color,attr"`
|
||||
Size int `xml:"w:sz,attr,omitempty"`
|
||||
Space int `xml:"w:space,attr,omitempty"`
|
||||
Color string `xml:"w:color,attr,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalXML ...
|
||||
@@ -788,12 +788,18 @@ func (t *WTableBorder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) erro
|
||||
case "val":
|
||||
t.Val = attr.Value
|
||||
case "sz":
|
||||
if attr.Value == "" {
|
||||
continue
|
||||
}
|
||||
sz, err := strconv.Atoi(attr.Value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t.Size = sz
|
||||
case "space":
|
||||
if attr.Value == "" {
|
||||
continue
|
||||
}
|
||||
space, err := strconv.Atoi(attr.Value)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user