New to Telerik Document ProcessingStart a free 30-day trial

TableCell

Updated on Jun 3, 2026

The TableCell class represents a single cell in a Table. Cells are added to a TableRow instance in the rows collection of a table. The main purpose of the cell is to contain, organize, and layout tabular data.

Inserting a TableCell

To add a cell to a Table, add it in the TableCellCollection of a TableRow.

The code in Example 1 shows how to create a table with a single row and add a cell in the first row.

Example 1: Create TableCell

C#
Table table = new Table();
TableRow firstRow = table.Rows.AddTableRow();
TableCell firstCell = firstRow.Cells.AddTableCell();

Adding Cell Content

Use the Blocks property of TableCell to add one or several IBlockElement instances to the cell.

Example 2 shows how to create a cell with a single Block in it.

Example 2: Add content to TableCell

C#
Block block = firstCell.Blocks.AddBlock();
block.InsertText("Text in the cell.");

Modifying a TableCell

You can change the cell presentation by using the following properties:

  • RowSpan: Defines the number of rows that the TableCell instance occupies.

  • ColumnSpan: Defines the number of columns that the TableCell instance occupies.

  • Padding: Specifies the distances between the cell borders inner contour and the cell content. If the value is null, the cell uses the padding from the table DefaultCellProperties.

  • Borders: Specifies the borders of the cell. If the value is null, the cell uses the value from the table DefaultCellProperties.

  • Background: Specifies the background of the cell. If null, the cell uses the background from the table DefaultCellProperties.

  • PreferredWidth: Specifies the preferred width of the cell. The final width of the cell may be bigger than the set value if another cell from the same column requires a bigger PreferredWidth.

  • VerticalAlignment: Specifies the vertical alignment of the content inside the cell.

Example 3 demonstrates how to set the cell properties locally to a specific cell. This helps achieve a different appearance for this cell by changing its borders and background. Additionally, the cell spans two rows and two columns.

Example 3: Change TableCell appearance

C#
firstCell.RowSpan = 2;
firstCell.ColumnSpan = 2;
firstCell.Borders = new TableCellBorders(new Border(1, new RgbColor(150, 0, 0)));
firstCell.Background = new RgbColor(255, 100, 100);

The result from Example 3 is illustrated in Figure 1.

Figure 1: TableCell

Rad Pdf Processing Editing Table Cell 01

See Also