API Reference

Class

WordTableCell

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word
Implements
IEquatable<WordTableCell>

Represents a single cell within a WordTable.

Inheritance

  • Object
  • WordTableCell

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by

Accepted by parameters

Constructors

public WordTableCell(WordDocument document, WordTable wordTable, WordTableRow wordTableRow) #

Create a WordTableCell and add it to given Table Row

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
wordTable OfficeIMO.Word.WordTable requiredposition: 1
wordTableRow OfficeIMO.Word.WordTableRow requiredposition: 2

Methods

public WordList AddList(WordListStyle style) #
Returns: WordList

Creates a list within this table cell using the specified style.

Parameters

style OfficeIMO.Word.WordListStyle requiredposition: 0
List style to apply.

Returns

The created WordList.

AddParagraph 2 overloads
public WordParagraph AddParagraph(WordParagraph paragraph = null, Boolean removeExistingParagraphs = false) #
Returns: WordParagraph

Add paragraph to the table cell

Parameters

paragraph OfficeIMO.Word.WordParagraph = null optionalposition: 0
The paragraph to add to this cell, if this is not passed then a new empty paragraph with settings from the previous paragraph will be added.
removeExistingParagraphs System.Boolean = false optionalposition: 1
If value is not passed or false then add the given paragraph into the cell. If set to true then clear every existing paragraph before adding the new paragraph.

Returns

A reference to the added paragraph.

public WordParagraph AddParagraph(String text, Boolean removeExistingParagraphs = false) #
Returns: WordParagraph

Add paragraph to the table cell with text

Parameters

text System.String requiredposition: 0
removeExistingParagraphs System.Boolean = false optionalposition: 1
public WordTable AddTable(Int32 rows, Int32 columns, WordTableStyle tableStyle = TableGrid, Boolean removePrecedingParagraph = false) #
Returns: WordTable

Add table to a table cell (nested table)

Parameters

rows System.Int32 requiredposition: 0
columns System.Int32 requiredposition: 1
tableStyle OfficeIMO.Word.WordTableStyle = TableGrid optionalposition: 2
removePrecedingParagraph System.Boolean = false optionalposition: 3
Equals 2 overloads
public virtual Boolean Equals(WordTableCell other) #
Returns: Boolean

Determines whether this instance and another cell reference the same underlying OpenXML cell.

Parameters

other OfficeIMO.Word.WordTableCell requiredposition: 0
public override Boolean Equals(Object obj) #
Returns: Boolean

Parameters

obj System.Object requiredposition: 0
public override Int32 GetHashCode() #
Returns: Int32
public Void MergeHorizontally(Int32 cellsCount, Boolean copyParagraphs = false) #
Returns: Void

Merges two or more cells together horizontally. Provides ability to move or delete content of merged cells into single cell

Parameters

cellsCount System.Int32 requiredposition: 0
copyParagraphs System.Boolean = false optionalposition: 1
public Void MergeVertically(Int32 cellsCount, Boolean copyParagraphs = false) #
Returns: Void

Merges two or more cells together vertically

Parameters

cellsCount System.Int32 requiredposition: 0
copyParagraphs System.Boolean = false optionalposition: 1
public static Boolean op_Equality(WordTableCell left, WordTableCell right) #
Returns: Boolean

Compares two cells for equality based on the underlying OpenXML cell reference.

Parameters

left OfficeIMO.Word.WordTableCell requiredposition: 0
right OfficeIMO.Word.WordTableCell requiredposition: 1
public static Boolean op_Inequality(WordTableCell left, WordTableCell right) #
Returns: Boolean

Determines whether two cells are not equal.

Parameters

left OfficeIMO.Word.WordTableCell requiredposition: 0
right OfficeIMO.Word.WordTableCell requiredposition: 1
public Void Remove() #
Returns: Void

Remove a cell from a table

public Void SplitHorizontally(Int32 cellsCount) #
Returns: Void

Splits (unmerge) cells that were merged

Parameters

cellsCount System.Int32 requiredposition: 0
public Void SplitVertically(Int32 cellsCount) #
Returns: Void

Splits (unmerge) cells that were merged vertically

Parameters

cellsCount System.Int32 requiredposition: 0
Number of cells to split including the current one

Properties

public WordTableCellBorder Borders { get; } #

Provides access to the border configuration of the cell.

public List<WordParagraph> Paragraphs { get; } #

Gets all WordParagraph instances contained in the cell.

public List<WordElement> Elements { get; } #

Gets the direct child elements contained in the cell in document order.

public WordTableRow Parent { get; } #

Gets the row that owns this cell.

public WordTable ParentTable { get; } #

Gets the table that owns this cell.

public Nullable<WordCellMerge> HorizontalMerge { get; set; } #

Gets or Sets Horizontal Merge for a Table Cell

public Nullable<WordCellMerge> VerticalMerge { get; set; } #

Gets or Sets Vertical Merge for a Table Cell

public Boolean HasHorizontalMerge { get; } #

Gets information whether the cell is part of a horizontal merge

public Boolean HasVerticalMerge { get; } #

Gets information whether the cell is part of a vertical merge

public Int32 ColumnSpan { get; } #

Gets the number of logical columns occupied by this cell.

public Int32 RowSpan { get; } #

Gets the number of logical rows occupied by this cell.

public String ShadingFillColorHex { get; set; } #

Get or set the background color of the cell using hexadecimal color code.

public Nullable<WordShadingPattern> ShadingPattern { get; set; } #

Get or set the background pattern of a cell

public Nullable<OfficeColor> ShadingFillColor { get; set; } #

Get or set the background color of a cell using OfficeIMO color.

public Nullable<Int32> Width { get; set; } #

Gets or sets cell width

public Nullable<WordTableWidthUnit> WidthType { get; set; } #

Gets or sets cell width type

public Nullable<WordTextDirection> TextDirection { get; set; } #

Gets or sets text direction in a Table Cell

public Nullable<WordTableVerticalAlignment> VerticalAlignment { get; set; } #

Gets or sets cell vertical alignment in a Table Cell

public Nullable<Int16> MarginTopWidth { get; set; } #

Gets or sets the top margin in twips for the current cell.

public Nullable<Int16> MarginBottomWidth { get; set; } #

Gets or sets the bottom margin in twips for the current cell.

public Nullable<Int16> MarginLeftWidth { get; set; } #

Gets or sets the left margin in twips for the current cell.

public Nullable<Int16> MarginRightWidth { get; set; } #

Gets or sets the right margin in twips for the current cell.

public Nullable<Double> MarginTopCentimeters { get; set; } #

Gets or sets the top margin in centimeters for the current cell.

public Nullable<Double> MarginBottomCentimeters { get; set; } #

Gets or sets the bottom margin in centimeters for the current cell.

public Nullable<Double> MarginLeftCentimeters { get; set; } #

Gets or sets the left margin in centimeters for the current cell.

public Nullable<Double> MarginRightCentimeters { get; set; } #

Gets or sets the right margin in centimeters for the current cell.

public Boolean WrapText { get; set; } #

Gets or sets whether text wraps within the cell.

public Boolean FitText { get; set; } #

Gets or sets whether text is compressed to fit within the cell width.

public Boolean HideMark { get; set; } #

Gets or sets whether the empty cell mark is hidden for this cell.

public Boolean HasNestedTables { get; } #

Gets information whether the cell contains other nested tables

public List<WordTable> NestedTables { get; } #

Get all nested tables in the cell