Tables
Basic Table filling with range
Input file template.docx: 
The range open and close actions are inside their own rows to avoid creating different tables each iteration.
Golang code:
go
package main
import (
"fmt"
gotemplatedocx "github.com/JJJJJJack/go-template-docx"
)
type ID struct {
ID int
IsActive bool
}
type ExampleStruct struct {
IDs []ID
}
func main() {
docxTemplate, err := gotemplatedocx.NewDocxTemplateFromFilename("template.docx")
if err != nil {
fmt.Println("Error loading template:", err)
return
}
templateValues := ExampleStruct{
IDs: []ID{
{ID: 1, IsActive: true},
{ID: 2, IsActive: false},
{ID: 3, IsActive: true},
},
}
err = docxTemplate.Apply(templateValues)
if err != nil {
fmt.Println("Error applying template values:", err)
return
}
err = docxTemplate.Save("template_output.docx")
if err != nil {
fmt.Println("Error saving output file:", err)
return
}
}Output file template_output.docx:
Change table cell color
Input file template.docx: 
Basic function syntax
{{tableCellBgColor "#FF0000"}}
Golang code:
same as above
Output file template_output.docx: 