In .docx, the “Table” does not directly contain other tables, but a table cell can be used. Thus, you cannot query the table for your nested tables, you need to get each cell and check them.
From XWPFTable, get your XWPFTableRow instances, and then from there XWPFTableCell. Then you can call XPWFTableCell.getTables () to get any tables nested in this cell.
source
share