# RtfTableCell

RTF table cell. Review signatures, members, parameters, type relationships, and available reference details in OfficeIMO.Rtf API Reference.

Class 

`OfficeIMO.Rtf`

**Namespace**

`OfficeIMO.Rtf`

**Assembly**

`OfficeIMO.Rtf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RtfTableCell.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L7)

**Implements**

`IRtfCloneable`

**Modifiers**

sealed

RTF table cell.

## Inheritance

- object
- RtfTableCell

## Usage

Explore 10 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.

### Returned or exposed by 10

- Method [RtfTableCell.SetBackgroundColor](/api/rtf/officeimo-rtf-rtftablecell/#method-setbackgroundcolor-nullable-system-int32)
- Method [RtfTableCell.SetFitText](/api/rtf/officeimo-rtf-rtftablecell/#method-setfittext-boolean)
- Method [RtfTableCell.SetHideCellMark](/api/rtf/officeimo-rtf-rtftablecell/#method-sethidecellmark-boolean)
- Method [RtfTableCell.SetNoWrap](/api/rtf/officeimo-rtf-rtftablecell/#method-setnowrap-boolean)
- Method [RtfTableCell.SetPadding](/api/rtf/officeimo-rtf-rtftablecell/#method-setpadding-nullable-system-int32-nullable-system-int32-nullable-system-int32-nullable-system-int32)
- Method [RtfTableCell.SetPreferredWidth](/api/rtf/officeimo-rtf-rtftablecell/#method-setpreferredwidth-nullable-system-int32-nullable-officeimo-rtf-rtftablewidthunit)
- Method [RtfTableCell.SetShading](/api/rtf/officeimo-rtf-rtftablecell/#method-setshading-nullable-system-int32-nullable-system-int32-nullable-system-int32-officeimo-rtf-rtfshadingpattern)
- Method [RtfTableCell.SetTextFlow](/api/rtf/officeimo-rtf-rtftablecell/#method-settextflow-nullable-officeimo-rtf-rtftablecelltextflow)
- Method [RtfTableRow.AddCell](/api/rtf/officeimo-rtf-rtftablerow/#method-addcell-nullable-system-int32)
- Property [RtfTableRow.Cells](/api/rtf/officeimo-rtf-rtftablerow/#property-cells)

Filter members 

Show inherited

## Constructors

`public RtfTableCell()` [#](#constructor-ctor)

[RtfTableCell.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L7)

## Methods

`public RtfParagraph AddParagraph(string? text = null)` [#](#method-addparagraph-string)

[RtfTableCell.cs:145](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L145)

Adds a paragraph to the cell.

Parameters

**text string? = null optional**

Returns

`RtfParagraph`

`public RtfTable AddTable(int rows, int columns)` [#](#method-addtable-int32-int32)

[RtfTableCell.cs:157](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L157)

Adds a nested table to the cell.

Parameters

**rows int required**

**columns int required**

Returns

`RtfTable`

`public RtfTableCell SetBackgroundColor(int? colorIndex)` [#](#method-setbackgroundcolor-nullable-system-int32)

[RtfTableCell.cs:99](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L99)

Sets cell background shading to a one-based color table index.

Parameters

**colorIndex int? required**

Returns

`RtfTableCell`

`public RtfTableCell SetFitText(bool fitText = true)` [#](#method-setfittext-boolean)

[RtfTableCell.cs:139](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L139)

Sets whether text is compressed to fit within the cell width.

Parameters

**fitText bool = true optional**

Returns

`RtfTableCell`

`public RtfTableCell SetHideCellMark(bool hidden = true)` [#](#method-sethidecellmark-boolean)

[RtfTableCell.cs:127](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L127)

Sets whether the end-of-cell mark is hidden.

Parameters

**hidden bool = true optional**

Returns

`RtfTableCell`

`public RtfTableCell SetNoWrap(bool noWrap = true)` [#](#method-setnowrap-boolean)

[RtfTableCell.cs:133](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L133)

Sets whether text should not wrap inside the cell.

Parameters

**noWrap bool = true optional**

Returns

`RtfTableCell`

`public RtfTableCell SetPadding(int? topTwips = null, int? leftTwips = null, int? bottomTwips = null, int? rightTwips = null)` [#](#method-setpadding-nullable-system-int32-nullable-system-int32-nullable-system-int32-nullable-system-int32)

[RtfTableCell.cs:90](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L90)

Sets cell padding in twips.

Parameters

**topTwips int? = null optional**

**leftTwips int? = null optional**

**bottomTwips int? = null optional**

**rightTwips int? = null optional**

Returns

`RtfTableCell`

`public RtfTableCell SetPreferredWidth(int? width, RtfTableWidthUnit? unit = null)` [#](#method-setpreferredwidth-nullable-system-int32-nullable-officeimo-rtf-rtftablewidthunit)

[RtfTableCell.cs:120](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L120)

Sets the preferred cell width.

Parameters

**width int? required**

**unit OfficeIMO.Rtf.RtfTableWidthUnit? = null optional**

Returns

`RtfTableCell`

`public RtfTableCell SetShading(int? backgroundColorIndex, int? foregroundColorIndex = null, int? patternPercent = null, RtfShadingPattern pattern = None)` [#](#method-setshading-nullable-system-int32-nullable-system-int32-nullable-system-int32-officeimo-rtf-rtfshadingpattern)

[RtfTableCell.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L105)

Sets cell shading color and pattern metadata.

Parameters

**backgroundColorIndex int? required**

**foregroundColorIndex int? = null optional**

**patternPercent int? = null optional**

**pattern OfficeIMO.Rtf.RtfShadingPattern = None optional**

Returns

`RtfTableCell`

`public RtfTableCell SetTextFlow(RtfTableCellTextFlow? textFlow)` [#](#method-settextflow-nullable-officeimo-rtf-rtftablecelltextflow)

[RtfTableCell.cs:114](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L114)

Sets the cell text flow.

Parameters

**textFlow OfficeIMO.Rtf.RtfTableCellTextFlow? required**

Returns

`RtfTableCell`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public IReadOnlyList<RtfParagraph> Paragraphs { get; }` [#](#property-paragraphs)

[RtfTableCell.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L11)

Paragraphs in the cell.

`public IReadOnlyList<IRtfBlock> Blocks { get; }` [#](#property-blocks)

[RtfTableCell.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L14)

Ordered cell blocks, including paragraphs and nested tables.

`public int? RightBoundaryTwips { get; set; }` [#](#property-rightboundarytwips)

[RtfTableCell.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L17)

Right cell boundary in twips.

`public RtfTableCellMerge HorizontalMerge { get; set; }` [#](#property-horizontalmerge)

[RtfTableCell.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L20)

Horizontal merge marker.

`public RtfTableCellMerge VerticalMerge { get; set; }` [#](#property-verticalmerge)

[RtfTableCell.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L23)

Vertical merge marker.

`public int? BackgroundColorIndex { get; set; }` [#](#property-backgroundcolorindex)

[RtfTableCell.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L26)

One-based color table index used for cell background shading.

`public int? ShadingForegroundColorIndex { get; set; }` [#](#property-shadingforegroundcolorindex)

[RtfTableCell.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L29)

One-based color table index used for cell pattern foreground shading.

`public int? ShadingPatternPercent { get; set; }` [#](#property-shadingpatternpercent)

[RtfTableCell.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L32)

Raw RTF \clshdng value, where 10000 represents 100 percent.

`public RtfShadingPattern ShadingPattern { get; set; }` [#](#property-shadingpattern)

[RtfTableCell.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L35)

Named RTF cell shading pattern.

`public RtfTableCellVerticalAlignment? VerticalAlignment { get; set; }` [#](#property-verticalalignment)

[RtfTableCell.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L38)

Vertical alignment for cell content.

`public RtfTableCellTextFlow? TextFlow { get; set; }` [#](#property-textflow)

[RtfTableCell.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L41)

Text flow for cell content.

`public int? PreferredWidth { get; set; }` [#](#property-preferredwidth)

[RtfTableCell.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L44)

Preferred cell width value carried by \clwWidth.

`public RtfTableWidthUnit? PreferredWidthUnit { get; set; }` [#](#property-preferredwidthunit)

[RtfTableCell.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L47)

Preferred cell width unit carried by \clftsWidth.

`public bool HideCellMark { get; set; }` [#](#property-hidecellmark)

[RtfTableCell.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L50)

Whether the end-of-cell mark is hidden, represented by \clhidemark.

`public bool NoWrap { get; set; }` [#](#property-nowrap)

[RtfTableCell.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L53)

Whether text should not wrap inside the cell, represented by \clNoWrap.

`public bool FitText { get; set; }` [#](#property-fittext)

[RtfTableCell.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L56)

Whether text is compressed to fit within the cell width, represented by \clFitText.

`public int? PaddingTopTwips { get; set; }` [#](#property-paddingtoptwips)

[RtfTableCell.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L59)

Top cell padding in twips.

`public int? PaddingLeftTwips { get; set; }` [#](#property-paddinglefttwips)

[RtfTableCell.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L62)

Left cell padding in twips.

`public int? PaddingBottomTwips { get; set; }` [#](#property-paddingbottomtwips)

[RtfTableCell.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L65)

Bottom cell padding in twips.

`public int? PaddingRightTwips { get; set; }` [#](#property-paddingrighttwips)

[RtfTableCell.cs:68](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L68)

Right cell padding in twips.

`public RtfTableCellBorder TopBorder { get; private set; }` [#](#property-topborder)

[RtfTableCell.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L71)

Top cell border.

`public RtfTableCellBorder LeftBorder { get; private set; }` [#](#property-leftborder)

[RtfTableCell.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L74)

Left cell border.

`public RtfTableCellBorder BottomBorder { get; private set; }` [#](#property-bottomborder)

[RtfTableCell.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L77)

Bottom cell border.

`public RtfTableCellBorder RightBorder { get; private set; }` [#](#property-rightborder)

[RtfTableCell.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L80)

Right cell border.

`public RtfTableCellBorder TopLeftToBottomRightBorder { get; private set; }` [#](#property-toplefttobottomrightborder)

[RtfTableCell.cs:83](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L83)

Diagonal cell border from top-left to bottom-right.

`public RtfTableCellBorder TopRightToBottomLeftBorder { get; private set; }` [#](#property-toprighttobottomleftborder)

[RtfTableCell.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfTableCell.cs#L86)

Diagonal cell border from top-right to bottom-left.

<!-- PowerForge markdown artifact sha256:5EBEC2442E7DD15462E9E28239C9AC4945B7930BCDC88ECABA15DC6452A2C0FD -->
