We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How merge cell?

i have code. I dont understand why second row is not wrapped full length. How make it?
Aspose.Words.Document doc = new Aspose.Words.Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// We call this method to start building the table.
builder.StartTable();
builder.InsertCell();
builder.Write("Row 1, Cell 1 Content.");
builder.InsertCell();
builder.Write("Row 1, Cell 2 Content.");
builder.EndRow();

builder.InsertCell();
builder.Write("axi.");
builder.EndRow();

// Signal that we have finished building the table.
builder.EndTable();
doc.Save("axo.doc");

http://s019.radikal.ru/i601/1601/c4/ea6f4764ea0e.png



Hi Ahvahsky,

Thanks for your inquiry. Please use following highlighted code snippet to get the required output and read following documentation link for your kind reference. Hope this helps you.

Working with Merged Cells


Aspose.Words.
Document doc = new Aspose.Words.Document();

DocumentBuilder builder = new DocumentBuilder(doc);

// We call this method to start building the table.

builder.StartTable();

builder.InsertCell();

builder.Write("Row 1, Cell 1 Content.");

builder.InsertCell();

builder.Write("Row 1, Cell 2 Content.");

builder.EndRow();

builder.InsertCell();

builder.CellFormat.HorizontalMerge = CellMerge.First;

builder.Write("axi.");

builder.InsertCell();

// This cell is merged to the previous and should be empty.

builder.CellFormat.HorizontalMerge = CellMerge.Previous;

builder.EndRow();

// Signal that we have finished building the table.

builder.EndTable();

doc.Save(MyDir + "Out.docx");