Get Started
Documentation

GetParentTable

GetParentTable() → { ApiTable }

Gets the parent table that contains the graphic object.

Returns:

Type
ApiTable

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = Api.CreateParagraph();
oTable = Api.CreateTable(3, 3);
oTable.SetWidth("percent", 100);
oFill = Api.CreateSolidFill(Api.CreateRGBColor(104, 155, 104));
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oDrawing = Api.CreateShape("rect", 3212465, 963295, oFill, oStroke);
oCell = oTable.GetCell(1, 1);
oCell.GetContent().GetElement(0).AddDrawing(oDrawing);
oDocument.Push(oTable);
oParentTable = oDrawing.GetParentTable();
oTableStyle.SetBasedOn(oDocument.GetStyle("Table Grid"));
oParentTable.SetStyle(oTableStyle);
builder.SaveFile("docx", "GetParentTable.docx");
builder.CloseFile();