# TableRow

`TableRow` represents a single row in a [Table](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/table/overview). Each row contains a collection of [TableCell](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/table/tablecell) instances.

* [Inserting a Row](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/table/tablerow#inserting-a-row-)

* [Using TableCellCollection](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/table/tablerow#using-tablecellcollection)

## Inserting a TableRow

You can add a `TableRow` instance by using the `AddTableRow()` method of the `Table` class.

The code in **Example 1** shows how to create a table and add a single row to it.

**Example 1: Create TableRow**

```C#
Table table = new Table();
TableRow tableRow = table.Rows.AddTableRow();
```

## Using TableCellCollection

To manipulate the cells in a row, use the `Cells` property of `TableRow`. The property represents the collection of cells added to this row and provides access to each of them.

**Example 2** shows how to add two cells in a row and get the cells count.

**Example 2: Access cells in a TableRow**

```C#
TableCell firstCell = tableRow.Cells.AddTableCell();
TableCell secondCell = tableRow.Cells.AddTableCell();
int cellsInRowCount = tableRow.Cells.Count;
```

## Setting TableRow Height

Starting with **Q1 2025**, you can configure the `TableRow` height through its `Height` property which accepts the following options defined in the `HeightType` enum:

* `Auto`: Automatically determines the row height.

* `Exact`: Sets an exact row height. The value is in [Device Independent Pixels](https://www.telerik.com/document-processing-libraries/documentation/common-information/device-independent-pixels) (DIPs).

* `AtLeast`: Sets a minimum row height. The value is in [Device Independent Pixels](https://www.telerik.com/document-processing-libraries/documentation/common-information/device-independent-pixels) (DIPs).

> note You can convert DIPs to other units using the [Unit](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Media.Unit.html) class.

**Example 3** creates a table with three single-cell rows, each with a different `HeightType`.

**Example 3: Set TableRow height**

```C#
RadFixedDocument radFixedDocument = new RadFixedDocument();
RadFixedPage page = radFixedDocument.Pages.AddPage();
FixedContentEditor documentPageEditor = new FixedContentEditor(page);

Table table = new Table();
Border border = new Border(1, BorderStyle.Single, new RgbColor(0, 0, 0));
table.Borders = new TableBorders(border);

TableRow row1 = table.Rows.AddTableRow();
row1.Height = new TableRowHeight(HeightType.Exact, 60);
TableCell row1Cell = row1.Cells.AddTableCell();
row1Cell.Borders = new TableCellBorders(border);
row1Cell.Blocks.AddBlock().InsertText("Row with \"Exact\" height 60.");

TableRow row2 = table.Rows.AddTableRow();
row2.Height = new TableRowHeight(HeightType.AtLeast, 100);
TableCell row2Cell = row2.Cells.AddTableCell();
row2Cell.Blocks.AddBlock().InsertText("Row with \"AtLeast\" height 100.");
row2Cell.Borders = new TableCellBorders(border);

TableRow row3 = table.Rows.AddTableRow();
row3.Height = new TableRowHeight(HeightType.Auto);
TableCell row3Cell = row3.Cells.AddTableCell();
row3Cell.Blocks.AddBlock().InsertText("Row with \"Auto\" height.");
row3Cell.Borders = new TableCellBorders(border);

documentPageEditor.DrawTable(table);
```

![RadPdfProcessing Rad Pdf Processing Editing TableRow Height](https://www.telerik.com/document-processing-libraries/documentation/assets/7c6a60c5fc956ba6dec6e6de33918698/radpdfprocessing_editing_tablerow_height.png)

## See Also

* [Table](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/table/overview)
* [TableCell](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/editing/table/tablecell)
* [How to Generate a Table with Images with PdfProcessing](https://www.telerik.com/document-processing-libraries/documentation/knowledge-base/generate-table-with-images-pdf-processing)
