RadPdfProcessing Table Overview
Use the Table class to generate tabular content in PDF documents with RadPdfProcessing. You define rows, cells, styling, and layout settings, and then pass the table to FixedContentEditor or RadFixedDocumentEditor to measure, position, draw, and split it across pages.
This overview explains the table building blocks, the main layout properties, and the different ways to insert or draw a table so you can choose the right workflow for your document scenario.

Each table contains a series of TableRow instances each of which contains a series of TableCell instances. To define a simple table, generate the table cells and add some content to them.
Use this article when you need to:
- Create a PDF table from code.
- Apply shared styling to table cells.
- Control layout behavior such as width, spacing, and border collapse.
- Insert a table into a document by using
RadFixedDocumentEditor. - Draw a table with
FixedContentEditorwhen you need extra placement control. - Measure a table before you render it.
If you are new to the document editors, start with the editor choice in this article and then continue to the linked editor documentation for API details.
Defining Table Content
Each Table contains a collection of TableRow instances, and each row contains a collection of TableCell instances. In practice, the workflow is straightforward:
to create a simple table, add the required cells and then assign content to each cell.
- Create a
Tableinstance. - Add rows and cells.
- Put content in each cell.
- Apply layout and styling properties.
- Insert or draw the table with the appropriate editor.
Example 1 creates a table with two rows and three columns and fills each cell with sample text.
Example 1: Create a Simple Table
Table table = new Table();
TableRow firstRow = table.Rows.AddTableRow();
firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell11");
firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell12");
firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell13");
TableRow secondRow = table.Rows.AddTableRow();
secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell21");
secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell22");
secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell23");
The result is shown in Figure 1.
Figure 1: Table

Using DefaultCellProperties
Use the table DefaultCellProperties property when the same styling should apply to every cell. This reduces repetitive cell-by-cell configuration and gives you a consistent base style for the whole table.
The most common default cell properties are:
| Property | Description |
|---|---|
Padding | Specifies the distances between the inner cell border contour and the cell content. |
Borders | Of type TableCellBorders. Specifies the borders of a single cell. The available borders are left, right, top, bottom, diagonal up, and diagonal down. |
Background | Specifies the background of the cell. |
Example 2 shows how to use the DefaultCellProperties of a table.
Example 2: Use DefaultCellProperties on a Table
Table table = new Table();
Border redBorder = new Border(2, new RgbColor(255, 0, 0));
table.DefaultCellProperties.Borders = new TableCellBorders(redBorder);
table.DefaultCellProperties.Padding = new Thickness(20, 10, 20, 10);
table.DefaultCellProperties.Background = new RgbColor(0, 255, 0);
TableRow firstRow = table.Rows.AddTableRow();
firstRow.Cells.AddTableCell();
firstRow.Cells.AddTableCell();
firstRow.Cells.AddTableCell();
TableRow secondRow = table.Rows.AddTableRow();
secondRow.Cells.AddTableCell();
secondRow.Cells.AddTableCell();
secondRow.Cells.AddTableCell();
The result of the snippet in Example 2 is demonstrated in Figure 2.
Figure 2: Result of DefaultCellProperties modification

Modifying a Table
Several table properties affect measurement, spacing, and rendering behavior:
-
Margin: Specifies the distances between the table borders outline and the rest of the document content.
-
Padding: Set through the
TableCellPaddingproperty, it specifies the distances between cell borders inner contour and the cell content. -
LayoutType: Specifies the algorithm used to layout table contents. Two options are available in the
TableLayoutTypeenumeration:- AutoFit – The table width fits the content unless the needed width is bigger than the available measuring width.
- FixedWidth – The table width always fits the available measuring width.
-
HorizontalAlignment: Specifies the alignment of the table inside the page.
-
BorderSpacing: Specifies the distance between all the borders in the table. This distance is measured differently depending on the BorderCollapse option.
-
BorderCollapse: Specifies the way the border spacing calculations are done. Two options are available:
- Collapse: The distance between borders is measured from the middle lines of the borders.
- Separate: The distance between borders is measured from the outer border contour.
Examples 3 through 6 show how border calculations change when you switch the BorderCollapse option. Example 3 creates an empty table and applies default cell padding and a red table border with thickness 10.
Example 3: Create a Table with a Red Border
Table table = new Table();
table.DefaultCellProperties.Padding = new Thickness(10, 6, 10, 6);
Border redBorder = new Border(10, new RgbColor(255, 0, 0));
table.Borders = new TableBorders(redBorder);
Example 4 adds a single row with two cells to the table from Example 3. The first cell has a green border with thickness 5, and the second cell has a blue border with thickness 3.
Example 4: Add Green and Blue Cells
TableRow tableRow = table.Rows.AddTableRow();
TableCell firstCell = tableRow.Cells.AddTableCell();
Border greenBorder = new Border(5, new RgbColor(0, 255, 0));
firstCell.Borders = new TableCellBorders(greenBorder, greenBorder, greenBorder, greenBorder);
firstCell.Blocks.AddBlock().InsertText("green bordered cell");
TableCell secondCell = tableRow.Cells.AddTableCell();
Border blueBorder = new Border(3, new RgbColor(0, 0, 255));
secondCell.Borders = new TableCellBorders(blueBorder, blueBorder, blueBorder, blueBorder);
secondCell.Blocks.AddBlock().InsertText("blue bordered cell");
Figure 3 shows the table from Example 3 and 4 with the BorderCollapse property set to Collapse. All borders are drawn so that their middle lines coincide.
Example 5: Collapse Borders
table.BorderCollapse = BorderCollapse.Collapse;
Figure 3: Collapsed border

Figure 4 shows the same table with BorderCollapse set to Separate, so the outer border contours coincide.
Example 6: Separate Borders
table.BorderCollapse = BorderCollapse.Separate;
Figure 4: Separated border

Drawing Table with RadFixedDocumentEditor
Use RadFixedDocumentEditor.InsertTable() when you want the editor to place the table in the document flow and split it across pages when needed. This is the easier option for standard document-generation scenarios.
Example 7 creates a simple table with two cells.
Example 7: Create a Table
Table table = new Table();
Border border = new Border();
table.Borders = new TableBorders(border);
table.DefaultCellProperties.Borders = new TableCellBorders(border, border, border, border);
table.BorderSpacing = 5;
table.BorderCollapse = BorderCollapse.Separate;
TableRow row = table.Rows.AddTableRow();
row.Cells.AddTableCell().Blocks.AddBlock().InsertText("First cell");
row.Cells.AddTableCell().Blocks.AddBlock().InsertText("Second cell");
Example 8 inserts the table from Example 7 in a RadFixedDocumentEditor and specifies the table layout type to AutoFit.
Example 8: Insert AutoFit table
using (RadFixedDocumentEditor editor = new RadFixedDocumentEditor(document))
{
table.LayoutType = TableLayoutType.AutoFit;
editor.InsertTable(table);
}
The result is that the table width is exactly as needed for fitting the cell content as visible in Figure 5.
Figure 5: AutoFit table

Using FixedWidth produces different results because the editor fits the table to the available measuring width.
Example 9: Insert a FixedWidth Table
using (RadFixedDocumentEditor editor = new RadFixedDocumentEditor(document))
{
table.LayoutType = TableLayoutType.FixedWidth;
editor.InsertTable(table);
}
Figure 6: FixedWidth table

Drawing Table with FixedContentEditor
Use FixedContentEditor.DrawTable() when you need lower-level drawing control, such as custom positioning, transforms, or rotation.
Example 10 draws a rotated table with FixedContentEditor.
Example 10: Draw a Rotated Table
Table table = new Table();
TableRow firstRow = table.Rows.AddTableRow();
firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell11");
firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell12");
firstRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell13");
TableRow secondRow = table.Rows.AddTableRow();
secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell21");
secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell22");
secondRow.Cells.AddTableCell().Blocks.AddBlock().InsertText("cell23");
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page, new SimplePosition());
editor.Position.Translate(10, 100);
editor.Position.Rotate(-45);
editor.DrawTable(table);
Figure 7 shows a 45-degree rotated table similar to the one in Figure 5.
Figure 7: Rotated table

Measuring a Table
The Table class exposes Measure overloads that calculate and return the desired size of the table without drawing it. This is useful when you need to know the table dimensions before inserting it into a document, for example when you must decide whether to use a new page or position other content relative to the table.
Use one of these overloads:
Measure(CancellationToken): Measures the table against an infinite available size and returns the resultingSize.Measure(Size, CancellationToken): Measures the table against a constrained available size when the table must fit within a known width or height.
Example 11 demonstrates both measurement approaches.
Example 11: Measure a Table
Table table = new Table();
TableRow row = table.Rows.AddTableRow();
TableCell cell = row.Cells.AddTableCell();
cell.Blocks.AddBlock().InsertText("Sample content");
// Measure against an infinite available size.
Size measuredSize = table.Measure(CancellationToken.None);
// Obsolete since Q2 2026
// Size measuredSize = table.Measure();
// Measure against a constrained available size.
Size availableSize = new Size(500, 800);
Size constrainedSize = table.Measure(availableSize, CancellationToken.None);
Supported Border Styles
Starting with Q3 2024, RadPdfProcessing supports the Dotted, Dashed, and DashSmallGap border styles in addition to BorderStyle.Single. Starting with the same release, Dotted, Dashed, DashSmallGap, and Thick border lines are also exported from RadFlowDocument to RadFixedDocument.
| BorderStyle | Border design |
|---|---|
Single | ![]() |
Dotted | ![]() |
Dashed | ![]() |
DashSmallGap | ![]() |
Typical Next Steps
Continue with the article that matches your next task:
- Use TableRow and TableCell when you want to customize row-level or cell-level behavior.
- Review Generating a Table with RadFixedDocumentEditor for a focused document-editor workflow.
- Review Creating Custom Layout Tables with RadPdfProcessing if you need more advanced layout control.
- Use Avoiding Table Splits Across Pages Using FixedContentEditor in RadPdfProcessing when page breaking is the main concern.
See Also
- FixedContentEditor
- RadFixedDocumentEditor
- TableRow
- TableCell
- How to Generate a Table with Images with PdfProcessing
- Creating Custom Layout Tables with RadPdfProcessing
- Implementing Column Span in RadPdfProcessing Tables
- Generating a Table with RadFixedDocumentEditor
- Avoiding Table Splits Across Pages Using FixedContentEditor in RadPdfProcessing
- How to Achieve Alternating Row Color for Tables in PdfProcessing



