Join Tables

Contents
[ ]

A table, represented in the Aspose.Words Document Object Model, is made up of independent rows and cells, making it easy to join tables.

To manipulate a table to join with another table, we just need to move the rows from the second table to the end of the first one and remove the second table’s container.

The following code example shows how to merge rows from two tables into one:

  • aspose.words.tables.Table — Represents a table in the document.
  • aspose.words.tables.Row — Represents a table row.
  • document.import_node(node, True) — Imports a node from another document, preserving formatting when the second argument is True.
  • row_collection.add(node) — Adds a row to the table’s row collection.
  • node.remove() — Removes the node from the document.