title: Novacode docx - add style to table
body: <p>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. </p>
  
  <p>Happy to take answers in both VB and C# </p>
  
  <p>this is what I have so far to build up the table and output it to the document</p>
  
  <pre><code>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
      tbl.Rows(0).Cells(i).Paragraphs.First().AppendLine(columnNames(i))
  Next
  For col = 0 To columnNames.Count - 1
      tbl.Rows(1).Cells(col).Paragraphs.First().AppendLine(gtRow(col))
  Next
  </code></pre>