GetTables

function GetTables(): ApiTable[]

Description

Returns a Tables array that represents all the tables nested within the specified table.

Returns

ApiTable[]

Try It

var oDocument = Api.GetDocument();
var oTable1 = Api.CreateTable(3, 3);
var oTable2 = Api.CreateTable(3, 3);
var oTable3 = Api.CreateTable(2, 2);
let oCell1 = oTable1.GetRow(0).GetCell(0);
let oCell2 = oTable1.GetRow(1).GetCell(1);
oTable1.AddElement(oCell1, 0, oTable2);
oTable1.AddElement(oCell2, 0, oTable3);
oTable1.SetWidth("percent", 100);
oDocument.Push(oTable1);
var arrTables = oTable1.GetTables();
arrTables[0].SetWidth("percent", 50);
arrTables[1].SetWidth("percent", 30);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).