summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
Diffstat (limited to 'table.go')
-rw-r--r--table.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/table.go b/table.go
index 45a1622..d26f8fd 100644
--- a/table.go
+++ b/table.go
@@ -77,7 +77,9 @@ func (f *File) AddTable(sheet, hcell, vcell, format string) error {
sheetRelationshipsTableXML := "../tables/table" + strconv.Itoa(tableID) + ".xml"
tableXML := strings.Replace(sheetRelationshipsTableXML, "..", "xl", -1)
// Add first table for given sheet.
- rID := f.addSheetRelationships(sheet, SourceRelationshipTable, sheetRelationshipsTableXML, "")
+ sheetPath, _ := f.sheetMap[trimSheetName(sheet)]
+ sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(sheetPath, "xl/worksheets/") + ".rels"
+ rID := f.addRels(sheetRels, SourceRelationshipTable, sheetRelationshipsTableXML, "")
f.addSheetTable(sheet, rID)
err = f.addTable(sheet, tableXML, hcol, hrow, vcol, vrow, tableID, formatSet)
if err != nil {