public override VisitorAction VisitCellStart(Tables.Cell cell)
{
// Determone index of current table
int tabIdx = mWordTables.IndexOf(cell.ParentRow.ParentTable);
// Determine index of current row
int rowIdx = cell.ParentRow.ParentTable.IndexOf(cell.ParentRow);
// And determine index of current cell
int cellIdx = cell.ParentRow.IndexOf(cell);
// Determine colspan and rowspan of current cell
int colSpan = 0;
int rowSpan = 0;
if (tabIdx < mTables.Count &&
rowIdx < mTables[tabIdx].Rows.Count &&
cellIdx < mTables[tabIdx].Rows[rowIdx].Cells.Count)
{
colSpan = mTables[tabIdx].Rows[rowIdx].Cells[cellIdx].ColSpan;
rowSpan = mTables[tabIdx].Rows[rowIdx].Cells[cellIdx].RowSpan;
}
Console.WriteLine("{0}.{1}.{2} colspan={3}\t rowspan={4}", tabIdx, rowIdx, cellIdx, colSpan, rowSpan);
return VisitorAction.Continue;
}
private List<TableInfo> mTables = new List<TableInfo>();