Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
A table, represented in the Aspose.Words Document Object Model, is made up of independent rows and cells, making it easy to split a table.
To manipulate a table to split it into two tables, we just need to move some of the rows from the original table to the new one. To do this, we need to pick the row by which we want to split the table.
We can create two tables from the original table by following these simple steps:
The following code example shows how to split a table into two tables on a specific row:
Q: How do I split a table at a particular row using Aspose.Words for Node.js?
A: Create a clone of the original table without its child nodes (table.clone(false)), insert the clone after the original, then move all rows starting from the split row to the cloned table using table.appendChild(row).
Q: Do I need to clone the table with its rows when splitting?
A: No. Clone the table without its children (clone(false)) so the new table starts empty; the rows you move will populate it, preserving the original formatting.
Q: Will the formatting of the moved rows be retained after the split?
A: Yes. Row and cell formatting are stored with each row, so moving rows to the new table keeps their appearance unchanged.
Q: Can I split a table into more than two tables?
A: Yes. Perform the same process repeatedly: clone the original (or a previously split) table, insert the clone, and move the desired range of rows to each new table.
Q: Is there a way to split a table without using the clone method?
A: While you could create a new Table instance manually and copy required properties, using clone(false) is the simplest and safest approach because it copies all table settings automatically.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.