Get Started
Usage API

GetRowIndex

GetRowIndex() → { number }

Gets the index of the parent row.

Parameters:

This method doesn't have any parameters.

Returns:

Type
number

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.SetWidth("percent", 100);
oTable.SetStyle(oTableStyle);
oDocument.Push(oTable);
oTable.GetCell(0, 0).GetContent().GetElement(0).AddText("Row index: " + oTable.GetCell(0, 0).GetRowIndex());
builder.SaveFile("docx", "GetRowIndex.docx");
builder.CloseFile();

Resulting document