# TableCellFormat Class

> An instance of the TableCellFormat class represents the formatting attributes of a table cell.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > TableCellFormat Class
- **1801 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/llms-full.txt

---

### Description

An instance of the TableCellFormat class represents the formatting attributes of a table cell.

### Syntax

```csharp
public class TableCellFormat
```

```vbnet
Public Class TableCellFormat
```

### Examples

The following example shows how to format a table cell.

```csharp
TXTextControl.TableCellFormat myCellFormat = new TXTextControl.TableCellFormat();

myCellFormat.BackColor = System.Drawing.Color.LightBlue;
myCellFormat.BottomBorderWidth = 150;
myCellFormat.VerticalAlignment = TXTextControl.VerticalAlignment.Bottom;

myTable.Cells.GetItem(1, 1).CellFormat = myCellFormat;
```

```vbnet
Dim MyCellFormat As New TXTextControl.TableCellFormat()

MyCellFormat.BackColor = System.Drawing.Color.LightBlue
MyCellFormat.BottomBorderWidth = 150
MyCellFormat.VerticalAlignment = TXTextControl.VerticalAlignment.Bottom

MyTable.Cells.GetItem(1, 1).CellFormat = MyCellFormat
```

The following example creates a small report table and works with its structure.

```csharp
textControl.Tables.Add(3, 3, 10);
Table table = textControl.Tables.GetItem(10);
TableCellFormat tableCellFormat = table.Cells[1, 1].CellFormat;
```

```vbnet
textControl.Tables.Add(3, 3, 10)
Dim table As Table = textControl.Tables.GetItem(10)
Dim tableCellFormat As TableCellFormat = table.Cells(1, 1).CellFormat
```

---

## In This Section

- [TableCellFormat.BackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/backcolor-property/llms-full.txt): Gets or sets the table cell's background color.
- [TableCellFormat.BottomBorderColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/bottombordercolor-property/llms-full.txt): Gets or sets the color of the table cell's bottom border.
- [TableCellFormat.BottomBorderWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/bottomborderwidth-property/llms-full.txt): Gets or sets, in twips, the width of the table cell's bottom border.
- [TableCellFormat.BottomTextDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/bottomtextdistance-property/llms-full.txt): Gets or sets, in twips, the distance between the table cell's bottom border and its text.
- [TableCellFormat.LeftBorderColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/leftbordercolor-property/llms-full.txt): Gets or sets the color of the table cell's left border.
- [TableCellFormat.LeftBorderWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/leftborderwidth-property/llms-full.txt): Gets or sets, in twips, the width of the table cell's left border.
- [TableCellFormat.LeftTextDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/lefttextdistance-property/llms-full.txt): Gets or sets, in twips, the distance between the table cell's left border and its text.
- [TableCellFormat.NumberFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/numberformat-property/llms-full.txt): Gets or sets a number format for the table cell. It can be used to automatically format numbers in table cells. When a formula is defined the automatically calculated text can also be formatted with a number format. When a number format is not defined, the property's value is an empty string. The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats. See Formatting Text by using Number Formats for more information.
- [TableCellFormat.RightBorderColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/rightbordercolor-property/llms-full.txt): Gets or sets the color of the table cell's right border.
- [TableCellFormat.RightBorderWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/rightborderwidth-property/llms-full.txt): Gets or sets, in twips, the width of the table cell's right border.
- [TableCellFormat.RightTextDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/righttextdistance-property/llms-full.txt): Gets or sets, in twips, the distance between the table cell's right border and its text.
- [TableCellFormat.TextType Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/texttype-property/llms-full.txt): Gets or sets the text type of the table cell which determines whether the cell's text is interpreted as a number or as text When the type is Standard, the cell's text is interpreted as text and it is displayed as it is. When the type is Number, the cell's text is interpreted as a number. The period character (.) is defined as decimal separator, the comma character (,) is defined as thousands separator.
- [TableCellFormat.TopBorderColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/topbordercolor-property/llms-full.txt): Gets or sets the color of the table cell's top border.
- [TableCellFormat.TopBorderWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/topborderwidth-property/llms-full.txt): Gets or sets, in twips, the width of the table cell's top border.
- [TableCellFormat.TopTextDistance Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/toptextdistance-property/llms-full.txt): Gets or sets, in twips, the distance between the table cell's top border and its text.
- [TableCellFormat.VerticalAlignment Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/verticalalignment-property/llms-full.txt): Gets or sets the vertical alignment of the text in the table cell.

---

## Nearby

- **Previous:** [TableCellCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellcollection/remove-method/llms-full.txt)
- **Next:** [TableCellFormat.BackColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tablecellformat/backcolor-property/llms-full.txt)
