Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordTableRow

OfficeIMO.Word

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

Represents a row within a WordTable and exposes row level operations.

Inheritance

  • object
  • WordTableRow

Usage

Explore 20 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 12

Constructors

public WordTableRow(WordDocument document, WordTable wordTable) #

Initializes a new instance of the WordTableRow class and creates an empty row.

Parameters

document OfficeIMO.Word.WordDocument required
The parent WordDocument.
wordTable OfficeIMO.Word.WordTable required
The table to which this row belongs.

Methods

public WordTableCell AddCell() #

Creates and appends a cell, returning the attached cell for further editing.

Equals 2 overloads
public bool Equals(WordTableRow? other) #

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

Parameters

other OfficeIMO.Word.WordTableRow? 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 List<WordTableCell> GetCells(bool readOnly = false) #

Returns cells for this row. When readOnly is true, wrappers are created without ensuring tcPr, avoiding DOM mutations on read.

Parameters

readOnly bool = false optional

Returns

List<WordTableCell>
public override int GetHashCode() #

Serves as the default hash function.

Returns

int A hash code for the current object.
public void MergeVertically(int cellIndex, int rowsCount, bool copyParagraphs = false) #

Merges cells starting from the specified column across subsequent rows.

Parameters

cellIndex int required
Column index of the first cell to merge.
rowsCount int required
Number of rows below this one to merge.
copyParagraphs bool = false optional
True to move paragraphs from merged cells to the first cell; false to discard them.
public static bool op_Equality(WordTableRow? left, WordTableRow? right) #

Compares two rows for equality based on the underlying OpenXML row reference.

Parameters

left OfficeIMO.Word.WordTableRow? required
right OfficeIMO.Word.WordTableRow? required

Returns

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

Determines whether two rows are not equal.

Parameters

left OfficeIMO.Word.WordTableRow? required
right OfficeIMO.Word.WordTableRow? required

Returns

bool
public void Remove() #

Remove a row

Properties

public List<WordTableCell> Cells { get; } #

Gets the row's cells in document order, including cells inside content controls and custom XML.

public WordTableCell FirstCell { get; } #

Return first cell for given row

public WordTableCell LastCell { get; } #

Return last cell for given row

public int CellsCount { get; } #

Gets cells count

public OfficeLength? Height { get; set; } #

Gets the declared row height as a physical length, or sets an exact height. Null removes the height constraint.

public OfficeLength? MinimumHeight { get; set; } #

Gets or sets the minimum row height as a physical length, allowing the row to grow to fit content. Setting a value replaces an exact height. Null removes a minimum constraint and preserves an exact height.

public bool AllowRowToBreakAcrossPages { get; set; } #

Gets or sets a value indicating whether the row is allowed to break across pages. When set to false, the row is kept intact on a single page.

public bool RepeatHeaderRowAtTheTopOfEachPage { get; set; } #

Gets or sets whether this table row should repeat at the top of each page. Word repeats contiguous header rows from the start of the table. Setting false explicitly overrides a repeating header inherited from a table style.

public WordTable Parent { get; } #

Gets the table that owns this row.