TableCellFormat Class
- Namespace
TXTextControl
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.dll
Description
An instance of the TableCellFormat class represents the formatting attributes of a table cell.
Syntax
public class TableCellFormatPublic Class TableCellFormatExamples
The following example shows how to format a table cell.
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;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 = MyCellFormatThe following example creates a small report table and works with its structure.
textControl.Tables.Add(3, 3, 10);
Table table = textControl.Tables.GetItem(10);
TableCellFormat tableCellFormat = table.Cells[1, 1].CellFormat;textControl.Tables.Add(3, 3, 10)
Dim table As Table = textControl.Tables.GetItem(10)
Dim tableCellFormat As TableCellFormat = table.Cells(1, 1).CellFormatMembers
Constructors
| Constructor | Description |
|---|---|
| TableCellFormat | Not described in the reference. public TableCellFormat(); |
Properties
| Property | Description |
|---|---|
| BackColor | Gets or sets the table cell's background color. |
| BottomBorderColor | Gets or sets the color of the table cell's bottom border. |
| BottomBorderWidth | Gets or sets, in twips, the width of the table cell's bottom border. |
| BottomTextDistance | Gets or sets, in twips, the distance between the table cell's bottom border and its text. |
| LeftBorderColor | Gets or sets the color of the table cell's left border. |
| LeftBorderWidth | Gets or sets, in twips, the width of the table cell's left border. |
| LeftTextDistance | Gets or sets, in twips, the distance between the table cell's left border and its text. |
| NumberFormat | 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. |
| RightBorderColor | Gets or sets the color of the table cell's right border. |
| RightBorderWidth | Gets or sets, in twips, the width of the table cell's right border. |
| RightTextDistance | Gets or sets, in twips, the distance between the table cell's right border and its text. |
| TextType | 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. |
| TopBorderColor | Gets or sets the color of the table cell's top border. |
| TopBorderWidth | Gets or sets, in twips, the width of the table cell's top border. |
| TopTextDistance | Gets or sets, in twips, the distance between the table cell's top border and its text. |
| VerticalAlignment | Gets or sets the vertical alignment of the text in the table cell. |