Tables
Create a table with new Table(rows, cols), index cells viatable[row, col], and add it with doc.AddTable(table). Tables can also be built from a DataTable, a CSV file/stream, or anIEnumerable<T>.
Create a Table Manually
Use case: Add a simple two-row table to the document.
Table from a DataTable
Use case: Render an existing ADO.NET DataTable into a Word table.
Table from an Enumerable
Use case: Populate a table from a strongly-typed collection.
Table from CSV
Use case: Load a CSV file directly as a table.
Merge Cells (Row)
Use case: Merge two cells in the first row into a single header.
Frequently asked questions
How do I merge cells?
Use TableCell.Split(rowSpan, colSpan), or Table.MergeCells(...)/TableRow.MergeCells(...) where implemented.
How can I style the entire table?
Assign a TableStyle to table.Style. You can set borders, shading, alignment, and per-column widths (via TableGridColsWidth).
Can I load a table from a database?
Yes — read your data into a DataTable (or an IEnumerable<T>), then use Table.FromDataTable(...) or Table.FromEnumerable(...).