GetAllTablesOnPage
Returns 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:
Name |
Type |
Description |
nPage |
number
|
The page number. |
Returns:
- Type
-
Array.<ApiTable>
Example
Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTableStyle = oDocument.GetStyle("Bordered");
var oTable = Api.CreateTable(3, 3);
oTable.SetWidth("percent", 50);
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
var arrTables = oDocument.GetAllTablesOnPage(0);
var oRow_1 = arrTables[0].GetRow(0);
oRow_1.Remove();
builder.SaveFile("docx", "GetAllTablesOnPage.docx");
builder.CloseFile();
Resulting document