Get Started
Usage API
More information

Copy

Copy() → { ApiTable }

Create a copy of a table.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiTable

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered - Accent 5"));
oTable = Api.CreateTable(2, 2);
oTable.SetWidth("percent", 100);
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
oCopyTable = oTable.Copy();
oDocument.Push(oCopyTable);
builder.SaveFile("docx", "Copy.docx");
builder.CloseFile();

Resulting document