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

Free Support Forum - aspose.com

How to remove table using C#


How to delete one table from Document doc=new Document(filepath)

Hi Ajeesh,

You can delete a table by using remove() method of table class. Please see the following code snippet for your kind reference.

// Load the document.

Document doc = new Document(MyDir + Table.Document.doc);

// Get the first and second table in the document.

// The rows from the second table will be appended to the end of the first table.

Table firstTable = (Table)doc.GetChild(NodeType.Table, 0, true);

Table secondTable = (Table)doc.GetChild(NodeType.Table, 1, true);

// Append all rows from the current table to the next.

// Due to the design of tables even tables with different cell count and widths can be joined into one table.

while (secondTable.HasChildNodes)


// Remove the empty table container.


doc.Save(MyDir + Table.CombineTables Out.doc);