Finding the index of any node involves gathering all child nodes of the element’s type from the parent node then using the NodeCollection.IndexOf method to find the index of the desired node in the collection.
Example
Retrieves the index of a table in the document.
[Java]
NodeCollection allTables = doc.getChildNodes(NodeType.TABLE, true);
int tableIndex = allTables.indexOf(table);
Example
Retrieves the index of a row in a table.
[Java]
int rowIndex = table.indexOf(row);
Example
Retrieves the index of a cell in a row.
[Java]
int cellIndex = row.indexOf(cell);