NextCell

Cell.NextCell property

Gets the next Cell node.

public Cell NextCell { get; }

Remarks

The method can be used when you need to have typed access to cells of a Row. If a StructuredDocumentTag node is found in a row instead of a cell, it is automatically traversed to get a cell contained within.

Examples

Shows how to enumerate through all table cells.

Document doc = new Document(MyDir + "Tables.docx");
Table table = doc.FirstSection.Body.Tables[0];

// Enumerate through all cells of the table.
for (Row row = table.FirstRow; row != null; row = row.NextRow)
{
    for (Cell cell = row.FirstCell; cell != null; cell = cell.NextCell)
    {
        Console.WriteLine(cell.GetText());
    }
}

See Also