PreviousCell

Cell.PreviousCell property

Hämtar föregåendeCell nod.

public Cell PreviousCell { get; }

Anmärkningar

Metoden kan användas när du behöver ha skrivåtkomst till celler i enRow Om a StructuredDocumentTag Om en nod hittas i en rad istället för i en cell, genomsöks den automatiskt för att hitta en cell som finns inuti.

Exempel

Visar hur man räknar igenom alla tabellceller.

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

// Räkna igenom alla celler i tabellen.
for (Row row = table.FirstRow; row != null; row = row.NextRow)
{
    for (Cell cell = row.FirstCell; cell != null; cell = cell.NextCell)
    {
        Console.WriteLine(cell.GetText());
    }
}

Se även