Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordTableCell

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
0eef6a5756b9 with working tree changes
Implements
IEquatable<WordTableCell>

Represents a single cell within a WordTable.

Inheritance

  • object
  • WordTableCell

Usage

Explore 18 API references to this type

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

Accepted by parameters 10

Methods

public WordList AddList(WordListStyle style) #

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

Parameters

style OfficeIMO.Word.WordListStyle required
List style to apply.

Returns

WordList The created WordList.
AddParagraph 2 overloads
public WordParagraph AddParagraph(WordParagraph? paragraph = null, bool removeExistingParagraphs = false) #

Add paragraph to the table cell

Parameters

paragraph OfficeIMO.Word.WordParagraph? = null optional
The paragraph to add to this cell, if omitted, a new empty paragraph is appended.
removeExistingParagraphs bool = false optional
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

WordParagraph A reference to the added paragraph.
public WordParagraph AddParagraph(string text, bool removeExistingParagraphs = false) #

Add paragraph to the table cell with text

Parameters

text string required
removeExistingParagraphs bool = false optional
public WordTable AddTable(int rows, int columns, WordTableStyle tableStyle = TableGrid, bool removePrecedingParagraph = false) #

Add table to a table cell (nested table)

Parameters

rows int required
columns int required
tableStyle OfficeIMO.Word.WordTableStyle = TableGrid optional
removePrecedingParagraph bool = false optional

Returns

WordTable
Equals 2 overloads
public bool Equals(WordTableCell? other) #

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

Parameters

other OfficeIMO.Word.WordTableCell? required

Returns

bool
public override bool Equals(object? obj) #

Determines whether the specified object is equal to the current object.

Parameters

obj object? required
The object to compare with the current object.

Returns

bool true if the specified object is equal to the current object; otherwise, false.
public override int GetHashCode() #

Serves as the default hash function.

Returns

int A hash code for the current object.
public void MergeHorizontally(int cellsCount, bool copyParagraphs = false) #

Merges this cell with the specified number of following logical cells.

Parameters

cellsCount int required
Number of additional cells to merge after this cell.
copyParagraphs bool = false optional
Moves merged cells' paragraphs into this cell when true; otherwise clears them.
public void MergeVertically(int cellsCount, bool copyParagraphs = false) #

Merges this cell with cells at the same logical index in the specified following rows.

Parameters

cellsCount int required
Number of additional rows to merge below this cell.
copyParagraphs bool = false optional
Moves merged cells' paragraphs into this cell when true; otherwise clears them.
public static bool op_Equality(WordTableCell? left, WordTableCell? right) #

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

Parameters

left OfficeIMO.Word.WordTableCell? required
right OfficeIMO.Word.WordTableCell? required

Returns

bool
public static bool op_Inequality(WordTableCell? left, WordTableCell? right) #

Determines whether two cells are not equal.

Parameters

left OfficeIMO.Word.WordTableCell? required
right OfficeIMO.Word.WordTableCell? required

Returns

bool
public void Remove() #

Remove a cell from a table

public void SplitHorizontally(int cellsCount) #

Removes horizontal merge declarations from this cell and the specified following logical cells.

Parameters

cellsCount int required
Number of additional cells to split after this cell.
public void SplitVertically(int cellsCount) #

Removes vertical merge declarations from this cell and cells at the same logical index below it.

Parameters

cellsCount int required
Number of additional rows to split below this cell.

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 WordCellMerge? HorizontalMerge { get; set; } #

Gets or Sets Horizontal Merge for a Table Cell

public WordCellMerge? VerticalMerge { get; set; } #

Gets or Sets Vertical Merge for a Table Cell

public bool HasHorizontalMerge { get; } #

Gets information whether the cell is part of a horizontal merge

public bool HasVerticalMerge { get; } #

Gets information whether the cell is part of a vertical merge

public int ColumnSpan { get; } #

Gets the number of logical columns occupied by this cell.

public int RowSpan { get; } #

Gets the number of logical rows occupied by this cell.

public WordShadingPattern? ShadingPattern { get; set; } #

Get or set the background pattern of a cell

public OfficeColor? ShadingFillColor { get; set; } #

Gets the resolved background color. Setting a role retains native theme slots and resolves status colors against the document. An automatic or unspecified fill returns null; setting null removes the shading.

public WordTableWidth? Width { get; set; } #

Gets or sets the directly authored preferred cell width. Null removes tcW.

public WordTextDirection? TextDirection { get; set; } #

Gets or sets text direction in a Table Cell

public WordTableVerticalAlignment? VerticalAlignment { get; set; } #

Gets or sets cell vertical alignment in a Table Cell

public OfficeLength? MarginTop { get; set; } #

Gets or sets the top margin as a physical length for the current cell.

public OfficeLength? MarginBottom { get; set; } #

Gets or sets the bottom margin as a physical length for the current cell.

public OfficeLength? MarginLeft { get; set; } #

Gets or sets the left margin as a physical length for the current cell.

public OfficeLength? MarginRight { get; set; } #

Gets or sets the right margin as a physical length for the current cell.

public bool HasNestedTables { get; } #

Gets information whether the cell contains other nested tables

public List<WordTable> NestedTables { get; } #

Get all nested tables in the cell

public bool WrapText { get; set; } #

Gets or sets whether text wraps within the cell.

public bool FitText { get; set; } #

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

public bool HideMark { get; set; } #

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