# TableColumnDefinition Class

> TableColumnDefinition class in the TX Sheet Control .NET API: Named table column with calculated and totals formulas. Includes the syntax and a C# example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Implements:** `System.IEquatable<TXTextControl.TXSheetControl.Server.TableColumnDefinition>`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > TableColumnDefinition Class
- **1042 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/llms-full.txt

---

Named table column with calculated and totals formulas; formulas use the shared JavaScript syntax.

### Syntax

```csharp
public class TableColumnDefinition
```

Interfaces: `IEquatable<TableColumnDefinition>`.

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [Formula](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/formula-property/llms-full.txt) |  |
| [Id](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/id-property/llms-full.txt) |  |
| [Name](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/name-property/llms-full.txt) |  |
| [TotalsFormula](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/totalsformula-property/llms-full.txt) |  |
| [TotalsFunction](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/totalsfunction-property/llms-full.txt) |  |
| [TotalsLabel](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/totalslabel-property/llms-full.txt) |  |

### Examples

Apply TableColumnDefinition to a small working document, then return the exported bytes. The caller can save or download the result.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateTableColumnDefinitionReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Range("A7:D9").SetValuesAsync(new object?[][]
    {
        ["Description", "Quantity", "UnitPrice", "Amount"],
        ["Consulting", 3, 120, 360],
        ["Training", 2, 90, 180]
    });

    var table = await sheet.Tables.AddAsync("InvoiceLines", "A7:D9", new TableOptions { Style = "TableStyleMedium2", ShowRowStripes = true });

    var settings = new TableColumnDefinition()
    {
        Formula = "=[@Quantity]*[@UnitPrice]",
        Name = "Amount"
    };

    await table.UpdateAsync(new TableOptions { Columns = [new() { Name = "Description" }, new() { Name = "Quantity" }, new() { Name = "UnitPrice" }, settings] });
    return await control.SaveAsync(StreamType.SpreadsheetML);
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Tables](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/tables/llms-full.txt)

---

## In This Section

- [TableColumnDefinition Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/constructor/llms-full.txt): TableColumnDefinition constructor in the TX Sheet Control .NET API, with its syntax, a C# example and remarks on awaiting tasks and handles.
- [TableColumnDefinition.Formula Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/formula-property/llms-full.txt): TableColumnDefinition.Formula property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [TableColumnDefinition.Id Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/id-property/llms-full.txt): TableColumnDefinition.Id property in the TX Sheet Control .NET API, with its syntax, its type string?, a C# example and remarks on awaiting tasks and handles.
- [TableColumnDefinition.Name Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/name-property/llms-full.txt): TableColumnDefinition.Name property in the TX Sheet Control .NET API, with its syntax, its type string and a C# example.
- [TableColumnDefinition.TotalsFormula Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/totalsformula-property/llms-full.txt): TableColumnDefinition.TotalsFormula property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [TableColumnDefinition.TotalsFunction Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/totalsfunction-property/llms-full.txt): TableColumnDefinition.TotalsFunction property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [TableColumnDefinition.TotalsLabel Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/totalslabel-property/llms-full.txt): TableColumnDefinition.TotalsLabel property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.

---

## Nearby

- **Previous:** [TableCollection.ListAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecollection/listasync-method/llms-full.txt)
- **Next:** [TableColumnDefinition Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/tablecolumndefinition/constructor/llms-full.txt)
