How to add/create tables in word document at run time?

Hi,
I have an empty word document. I am trying to dynamically add/create a table with 3 columns and 2 rows in this document (numbers may vary). How can we do this? Please help.
Thank you.

Hi
Thanks for your inquiry. The easiest way to create table is using Documentbuilder. Please see the following link for more information.
https://docs.aspose.com/words/net/document-builder-overview/

Also see the following code example:

// Create new Document and DocumentBuilder
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Set borders
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = Color.Red;
// Generate simple table
for (int i = 0; i <2; i++)
{
    for (int j = 0; j <3; j++)
    {
        // Insert cell
        builder.InsertCell();
        builder.Write("test");
    }
    builder.EndRow();
}
builder.EndTable();
// Save document
doc.Save(@"Test\out.doc");

Hope this helps.
Best regards,