Get Started
Usage API
More information

GetAllTablesOnPage

GetAllTablesOnPage() → { Array.<ApiTable> }

Get a collection of tables on a given absolute page. This method can be a little bit slow, because it runs the document calculation process to arrange tables on the specified page.

Parameters:

This method doesn't have any parameters.

Returns:

Type
Array.<ApiTable>

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oBlockLvlSdt = Api.CreateBlockLvlSdt();
oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered - Accent 5"));
oTable1 = Api.CreateTable(3, 3);
oTable1.SetWidth("percent", 100);
oTable1.SetStyle(oTableStyle);
oBlockLvlSdt.AddElement(oTable1, 0);
oTable2 = Api.CreateTable(2, 2);
oTable2.SetWidth("percent", 100);
oTable2.SetStyle(oTableStyle);
oBlockLvlSdt.AddElement(oTable2, 1);
oDocument.AddElement(0, oBlockLvlSdt);
aTables = oBlockLvlSdt.GetAllTablesOnPage(0);
oCell = aTables[0].GetRow(1).GetCell(0);
aTables[0].RemoveRow(oCell);
builder.SaveFile("docx", "GetAllTablesOnPage.docx");
builder.CloseFile();

Resulting document