IRONSOFTWAREHOME
Add Table
using IronWord;
using IronWord.Models;

// Create table
Table table = new Table(5, 3);

// Apply styling
table.Zebra = new ZebraColor("FFFFFF", "dddddd");

// Populate table
table[0, 0] = new TableCell(new TextContent("Number"));
table[0, 1] = new TableCell(new TextContent("First Name"));
table[0, 2] = new TableCell(new TextContent("Last Name"));
for (int i = 1; i < table.Rows.Count; i++)
{
    table[i, 0].AddChild(new TextContent($"{i}"));
    table[i, 1].AddChild(new TextContent($"---"));
    table[i, 2].AddChild(new TextContent($"---"));
}

// Create new Word document from the table
WordDocument doc = new WordDocument(table);

// Export Word document
doc.SaveAs("Document.docx");
Imports IronWord
Imports IronWord.Models

' Create table
Dim table As New Table(5, 3)

' Apply styling
table.Zebra = New ZebraColor("FFFFFF", "dddddd")

' Populate table
table(0, 0) = New TableCell(New TextContent("Number"))
table(0, 1) = New TableCell(New TextContent("First Name"))
table(0, 2) = New TableCell(New TextContent("Last Name"))
For i As Integer = 1 To table.Rows.Count - 1
    table(i, 0).AddChild(New TextContent($"{i}"))
    table(i, 1).AddChild(New TextContent("---"))
    table(i, 2).AddChild(New TextContent("---"))
Next

' Create new Word document from the table
Dim doc As New WordDocument(table)

' Export Word document
doc.SaveAs("Document.docx")
NuGet Download
PM > Install-Package IronWord
Add Table

Add Table

A table is a grid of cells arranged in rows and columns. It's a fundamental feature that allows you to organize and present information in a structured manner. Each intersection of a row and a column in a table is referred to as a cell. Tables are commonly used for various purposes, such as creating schedules, organizing data, and aligning content neatly.

To add a table using IronWord, first instantiate a table by providing the number of rows and columns. Customize the entire table styling to your requirements. Access each cell of the table with the [row, column] format. With this, you can style each cell accordingly and add multiple document elements such as Run, paragraph, image, and shape to the cell. Once the table object has been set up properly, it can be used to create a new Word document.

Learn How to Add Tables in Word with IronWord
View on GitHub

Ready to Get Started?

Nuget Downloads 56,401Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required