-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Here is the reproduction code
package main
import (
"log"
docx "github.com/mmonterroca/docxgo/v2"
"github.com/mmonterroca/docxgo/v2/domain"
)
func main() {
doc := docx.NewDocument()
table, _ := doc.AddTable(1, 1)
table.SetWidth(domain.TableWidth{
Type: domain.WidthPct,
Value: 100 * 50, // 100% in twentieths of a percent
})
// cell
row, _ := table.Row(0)
cell, _ := row.Cell(0)
par, _ := cell.AddParagraph()
run, _ := par.AddRun()
run.SetText("Hello, World!")
bd := domain.BorderStyle{
Style: domain.BorderSingle,
Width: 8,
Color: domain.Color{R: 200, G: 200, B: 200},
}
err := cell.SetBorders(domain.TableBorders{
Top: bd,
Left: bd,
Bottom: bd,
Right: bd,
})
if err != nil {
log.Fatal(err)
}
err = doc.SaveAs("test.docx")
if err != nil {
log.Fatal(err)
}
}output:

Metadata
Metadata
Assignees
Labels
No labels