mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
parent
8d6c99bcdd
commit
bc4407804f
@ -49,9 +49,22 @@ func main() {
|
||||
cell := row.AddCell()
|
||||
// column span / merged cells
|
||||
cell.Properties().SetColumnSpan(2)
|
||||
|
||||
run := cell.AddParagraph().AddRun()
|
||||
run.AddText("Cells can span multiple columns")
|
||||
|
||||
row = table.AddRow()
|
||||
cell = row.AddCell()
|
||||
cell.Properties().SetVerticalMerge(wml.ST_MergeRestart)
|
||||
cell.AddParagraph().AddRun().AddText("Vertical Merge")
|
||||
row.AddCell().AddParagraph().AddRun().AddText("")
|
||||
|
||||
row = table.AddRow()
|
||||
cell = row.AddCell()
|
||||
cell.Properties().SetVerticalMerge(wml.ST_MergeContinue)
|
||||
cell.AddParagraph().AddRun().AddText("Vertical Merge 2")
|
||||
row.AddCell().AddParagraph().AddRun().AddText("")
|
||||
|
||||
row = table.AddRow()
|
||||
row.AddCell().AddParagraph().AddRun().AddText("Street Address")
|
||||
row.AddCell().AddParagraph().AddRun().AddText("111 Country Road")
|
||||
|
Binary file not shown.
@ -35,6 +35,16 @@ func (c CellProperties) SetColumnSpan(cols int) {
|
||||
}
|
||||
}
|
||||
|
||||
// SetVerticalMerge controls the vertical merging of cells.
|
||||
func (c CellProperties) SetVerticalMerge(mergeVal wml.ST_Merge) {
|
||||
if mergeVal == wml.ST_MergeUnset {
|
||||
c.x.VMerge = nil
|
||||
} else {
|
||||
c.x.VMerge = wml.NewCT_VMerge()
|
||||
c.x.VMerge.ValAttr = mergeVal
|
||||
}
|
||||
}
|
||||
|
||||
// SetWidthAuto sets the the cell width to automatic.
|
||||
func (c CellProperties) SetWidthAuto() {
|
||||
c.x.TcW = wml.NewCT_TblWidth()
|
||||
|
Loading…
x
Reference in New Issue
Block a user