Skip to content

Commit

Permalink
Merge pull request #65 from itldg/main
Browse files Browse the repository at this point in the history
fix: #47 表格应插入到模板标签位置而不是最后一行
  • Loading branch information
shps951023 authored Feb 19, 2024
2 parents 2c2d455 + e7bebd5 commit 14a7195
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/MiniWord/MiniWord.Implment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,15 @@ private static void Generate(this OpenXmlElement xmlElement, WordprocessingDocum
ReplaceStatements(newTr, tags: dic);

ReplaceText(newTr, docx, tags: dic);
table.Append(newTr);
//Fix #47 表格应插入到模板标签位置而不是最后一行\
if (table.Contains(tr))
{
table.InsertBefore(newTr, tr);
}
else {
//如果是嵌套表,暂时按原来的方案追加到末尾
table.Append(newTr);
}
}
tr.Remove();
}
Expand Down

0 comments on commit 14a7195

Please sign in to comment.