How to create separate tables vertically in aspose word .NET

I need to create 3 separate tables vertically in aspose word in .NET.
Please find the attached image.
anyone could you please advice ? Thanks

format.png (10.4 KB)

@kasun_8777 You can achieve this using text columns. for example see the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Spacify number of text columns in the current section.
builder.PageSetup.TextColumns.SetCount(3);

// Build 3 tables, one in each text column.
builder.Writeln();
BuildTestTable(builder);
builder.InsertBreak(BreakType.ColumnBreak);
BuildTestTable(builder);
builder.InsertBreak(BreakType.ColumnBreak);
BuildTestTable(builder);

doc.Save(@"C:\Temp\out.docx");
private static void BuildTestTable(DocumentBuilder builder)
{
    builder.StartTable();
    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            builder.InsertCell();
            builder.Write(string.Format("cell_{0}_{1}", i, j));
        }
        builder.EndRow();
    }
    Table table = builder.EndTable();
    table.AutoFit(AutoFitBehavior.AutoFitToWindow);
}

out.docx (7.3 KB)

Thank you for the Quick response. this is really helpful. Thank a lot.

1 Like