Simon Price Simon Price - 9 months ago 346 Question

Novacode docx - add style to table

I am using Novacode Docx to build a document based on webpage responses and need to know how \ where to apply a style to my table.

Happy to take answers in both VB and C#

this is what I have so far to build up the table and output it to the document

Dim columnNames As IEnumerable(Of String)
Dim tbl As Table = doc.AddTable(glossTable.Rows.Count - 1, glossTable.Columns.Count - 1)
columnNames = glossTable.Columns.Cast(Of DataColumn)().[Select](Function(column) column.ColumnName)
For i = 0 To columnNames.Count - 1
For col = 0 To columnNames.Count - 1


There is an enum of available table designs that can be used. The names should match the styles in MS Word.


tbl.Design = TableDesign.LightShadingAccent1