Get Started
Documentation

GetParentTableCell

GetParentTableCell() → { ApiTableCell | null }

Gets the table cell that contains the content control.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiTableCell | null

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oTableStyle = oDocument.CreateStyle("CustomTableStyle", "table");
oTableStyle.SetBasedOn(oDocument.GetStyle("Bordered - Accent 5"));
oTable = Api.CreateTable(3, 3);
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
oBlockLvlSdt = Api.CreateBlockLvlSdt();
oBlockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control.");
oCell = oTable.GetRow(0).GetCell(0);
oCell.AddElement(0, oBlockLvlSdt);
oParentTableCell = oBlockLvlSdt.GetParentTableCell();
oParentTableCell.SetCellBorderTop("single", 32, 0, 0, 0, 255);
builder.SaveFile("docx", "GetParentTableCell.docx");
builder.CloseFile();

Resulting document