1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-09 17:50:27 +08:00

add w:tblpPr w:jc to table

This commit is contained in:
源文雨
2023-02-24 21:23:22 +08:00
parent bc8697cc87
commit 6e9f1befa5
4 changed files with 135 additions and 23 deletions

View File

@@ -97,9 +97,11 @@ func main() {
w.AddParagraph()
tbl2 := w.AddTableTwips([]int64{2333, 2333, 2333}, []int64{2333, 2333})
tbl2 := w.AddTableTwips([]int64{2333, 2333, 2333}, []int64{2333, 2333}).Justification("center")
for x, r := range tbl2.TableRows {
r.Justification("center")
for y, c := range r.TableCells {
c.TableCellProperties.VAlign = &docxlib.WVerticalAlignment{Val: "center"}
c.AddParagraph().Justification("center").AddText(fmt.Sprintf("(%d, %d)", x, y))
}
}