# Table Class

> Table class in the TX Sheet Control .NET API: A table identity bound to one worksheet generation; access fails after deletion or document replacement.

- **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)
- **Inherits:** `TXTextControl.TXSheetControl.Server.DocumentObject`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > Table Class
- **1381 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/llms-full.txt

---

A table identity bound to one worksheet generation; access fails after deletion or document replacement.

### Syntax

```csharp
public class Table
```

### Members

#### Properties

| Property | Description |
|---|---|
| [Id](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/id-property/llms-full.txt) |  |

#### Methods

| Method | Description |
|---|---|
| [DeleteColumnsAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/deletecolumnsasync-method/llms-full.txt) | Deletes count table columns at a zero-based column index in one undoable operation. Throws for invalid bounds, protection, split ranges or worksheet overflow. Retained column identities are preserved; deleting all columns removes the table. |
| [DeleteRowsAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/deleterowsasync-method/llms-full.txt) | Deletes count table rows at a zero-based data-row index in one undoable operation. Throws for invalid bounds, protection, split ranges or worksheet overflow. Headers and totals are retained; deleting all data rows leaves one blank row. |
| [GetSnapshotAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/getsnapshotasync-method/llms-full.txt) | Reads detached columns, range, style, totals and expansion settings. |
| [InsertColumnsAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/insertcolumnsasync-method/llms-full.txt) | Inserts count table columns at a zero-based column index in one undoable operation. Throws for invalid bounds, protection, split ranges or worksheet overflow. Retained column identities are preserved; deleting all columns removes the table. |
| [InsertRowsAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/insertrowsasync-method/llms-full.txt) | Inserts count table rows at a zero-based data-row index in one undoable operation. Throws for invalid bounds, protection, split ranges or worksheet overflow. Headers and totals are retained; deleting all data rows leaves one blank row. |
| [RemoveAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/removeasync-method/llms-full.txt) | Converts the table to ordinary cells, retaining content and existing formatting. |
| [RenameAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/renameasync-method/llms-full.txt) | Renames the table and updates structured references throughout the workbook. |
| [ResizeAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/resizeasync-method/llms-full.txt) | Resizes to a non-overlapping range while retaining its named columns. |
| [SetColumnAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/setcolumnasync-method/llms-full.txt) | Updates a named column's calculated formula or totals calculation. |
| [UpdateAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/updateasync-method/llms-full.txt) | Changes table settings without replacing identity; affected cells participate in the same transaction. |

### Examples

Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateTableReportAsync(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 });
    await table.SetColumnAsync("Amount", new TableColumnOptions { Formula = "=[@Quantity]*[@UnitPrice]" });
    await sheet.Range("C8:D9").FormatAsync(new { numberFormatCode = "#,##0.00", fontFamily = "Liberation Sans", fontSize = 11 });
    return await control.SaveAsync(StreamType.PDF);
}
```

### 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

- [Table.DeleteColumnsAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/deletecolumnsasync-method/llms-full.txt): Table.DeleteColumnsAsync method in the TX Sheet Control .NET API: Deletes count table columns at a zero-based column index in one undoable operation.
- [Table.DeleteRowsAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/deleterowsasync-method/llms-full.txt): Table.DeleteRowsAsync method in the TX Sheet Control .NET API: Deletes count table rows at a zero-based data-row index in one undoable operation.
- [Table.GetSnapshotAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/getsnapshotasync-method/llms-full.txt): Table.GetSnapshotAsync method in the TX Sheet Control .NET API: Reads detached columns, range, style, totals and expansion settings.
- [Table.Id Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/id-property/llms-full.txt): Table.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.
- [Table.InsertColumnsAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/insertcolumnsasync-method/llms-full.txt): Table.InsertColumnsAsync method in the TX Sheet Control .NET API: Inserts count table columns at a zero-based column index in one undoable operation.
- [Table.InsertRowsAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/insertrowsasync-method/llms-full.txt): Table.InsertRowsAsync method in the TX Sheet Control .NET API: Inserts count table rows at a zero-based data-row index in one undoable operation.
- [Table.RemoveAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/removeasync-method/llms-full.txt): Table.RemoveAsync method in the TX Sheet Control .NET API: Converts the table to ordinary cells, retaining content and existing formatting.
- [Table.RenameAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/renameasync-method/llms-full.txt): Table.RenameAsync method in the TX Sheet Control .NET API: Renames the table and updates structured references throughout the workbook.
- [Table.ResizeAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/resizeasync-method/llms-full.txt): Table.ResizeAsync method in the TX Sheet Control .NET API: Resizes to a non-overlapping range while retaining its named columns.
- [Table.SetColumnAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/setcolumnasync-method/llms-full.txt): Table.SetColumnAsync method in the TX Sheet Control .NET API: Updates a named column's calculated formula or totals calculation.
- [Table.UpdateAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/updateasync-method/llms-full.txt): Table.UpdateAsync method in the TX Sheet Control .NET API: Changes table settings without replacing identity. Includes the syntax and a C# example.

---

## Nearby

- **Previous:** [StreamType Enumeration](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/streamtype/llms-full.txt)
- **Next:** [Table.DeleteColumnsAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/table/deletecolumnsasync-method/llms-full.txt)
