Represents a table cell in a table in the Word document.

 public sealed class TableCell : Element
Public NotInheritable Class TableCell
		Inherits Element

New table cells are created when you create a new Table. They cannot be created independent of a Table using the new keyword.

To retrieve and manipulate a table cell, use array index notation on a Table object. You can also use Element.GetElements(Element.Type.TableCell) to get all elements, of which you can check which ones are of type TableCell.

The following sample demonstrates getting a reference to a table cell at column 3 (4th column), row 2 (3rd row).


          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          Table table = (Table)doc.GetElements(Element.Type.Table)[0];
          TableCell cell = table[3, 2];
        

          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim table As Table = doc.GetElements(Element.Type.Table)(0)
          Dim cell As TableCell = table(3, 2)
        

Name

Description

CellWidthUnits

FirstMerged

FirstVerticalMerged

Merged

NoWrap

PreferredWidth

Shading

VertAlignment

VerticalMerged

Name

Description

ApplyFont(Font)

ApplyParagraphFormatting(ParagraphFormatting)

GetBorder(Border.Location)

GetPadding(TableCell.Location)

SetPadding(TableCell.Location, Int32)

Name

Description

Location

VerticalAlignment

WidthUnits