# TableCellAttribute Property

> Returns or sets an attribute of a table cell, row, column or table by constant: position, borders and border colors, text gaps, background color and more.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Property
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > TableCellAttribute Property
- **1149 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tablecellattribute-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tablecellattribute-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tablecellattribute-property/llms-full.txt

---

Returns or sets attributes of a table cell.

### Syntax

```vbscript
TXTextControl.TableCellAttribute(TableId, Row, Column, Attribute) [= value]
```

### Parameters

| Parameter | Description |
|---|---|
| TableId | Specifies a table. It is the same identifier set with the [TableInsert](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tableinsert-method/llms-full.txt) method. |
| Row | Specifies a row number which identifies a certain cell in the table. The first row has the number one. This parameter set to zero means a complete column. |
| Column | Specifies a column number which identifies a certain cell in the table. The first column has the number one. This parameter set to zero means a complete row. |
| Attribute | Specifies the type of attribute. It can be anyone of the values listed in Constants. |

### Constants

Valid values for the Attribute parameter are:

| Constant | Description |
|---|---|
| txTableCellHorizontalPos (0) | The property value is the horizontal position of a table cell. |
| txTableCellHorizontalExt (1) | The property value is the horizontal extension of a table cell. |
| txTableCellBorderWidth (2) | The property value is the border width of a table cell. |
| txTableCellTextGap (3) | The property value is the width of the gap between a cell's border and its text. |
| txTableCellBackColor (4) | The property value is the table cell's background color. |
| txTableCellLeftBorderWidth (5) | The property value is the left border width of a table cell. |
| txTableCellTopBorderWidth (6) | The property value is the top border width of a table cell. |
| txTableCellRightBorderWidth (7) | The property value is the right border width of a table cell. |
| txTableCellBottomBorderWidth (8) | The property value is the bottom border width of a table cell. |
| txTableCellLeftTextGap (9) | The property value is the width of the gap between a cell's left border and its text. |
| txTableCellTopTextGap (10) | The property value is the width of the gap between a cell's top border and its text. |
| txTableCellRightTextGap (11) | The property value is the width of the gap between a cell's right border and its text. |
| txTableCellBottomTextGap (12) | The property value is the width of the gap between a cell's bottom border and its text. |
| txTableCellVertAlign (13) | The property value defines the vertical alignment of the cell's text. The following values are possible: |
| txTableCellHeight (14) | The property value is the minimum height of a table cell. If zero is set or returned, the cell's height is always determined through the containing text. |
| txTableCellPageBreakAllowed (15) | The property value is True, if the table cell can be formatted across page breaks. The property value is False, if the table cell must not be formatted across page breaks. |
| txTableCellIsHeader (16) | The property value is True, if the table cell belongs to a table header. The property value is False, if the table cell does not belong to a table header. |
| txTableCellLeftBorderColor (17) | The property value is the color of the table cell's left border line. |
| txTableCellTopBorderColor (18) | The property value is the color of the table cell's top border line. |
| txTableCellRightBorderColor (19) | The property value is the color of the table cell's right border line. |
| txTableCellBottomBorderColor (20) | The property value is the color of the table cell's bottom border line. |

#### txTableCellVertAlign (13)

| Constant | Description |
|---|---|
| 0 | The text is aligned at the top of the cell. |
| 1 | The text is vertically centered. |
| 2 | The text is aligned at the bottom of the cell. |

### Data Types

| Name | Data type |
|---|---|
| TableId | Integer |
| Row | Integer |
| Column | Integer |
| Attribute | Integer |
| Property value | Variant |

### Examples

This Basic example sets a red background color for the leftmost column of a table:

```vbscript
TXTextControl1.TableCellAttribute(id, 0, 1, 4) = RGB(255, 0, 0)
```

### Limitations

Run time only.

### Remarks

When the row and column parameters are both set to zero the attributes of a complete table can be manipulated. When more than one table cell is specified this property returns Null (Visual Basic) or is set to empty (C++) if the cells are differently formatted.

### See Also

- [Formatting Text by using Number Formats](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables/number-formats/llms-full.txt)
- [Tables](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables/llms-full.txt)
- [Using Formulas in Table Cells](https://docs.textcontrol.com/tx-text-control-activex/document-editor/tables/formulas/llms-full.txt)
- [TableInsert Method](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tableinsert-method/llms-full.txt)
- [TableCellText Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tablecelltext-property/llms-full.txt)
- [Programming Category: Tables](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/tables/llms-full.txt)

---

## Nearby

- **Previous:** [TableCanSplitCells Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tablecansplitcells-property/llms-full.txt)
- **Next:** [TableCellData Property](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tablecelldata-property/llms-full.txt)
