New to Telerik Document Processing? Start a free 30-day trial
Creating a Dashed Line Border for a Table in RadPdfProcessing
Updated on Jun 5, 2026
Environment
| Version | Product | Author |
|---|---|---|
| 2024.1.124 | RadPdfProcessing | Desislava Yordanova |
Description
This article shows how to add a dashed line border in a table by using RadPdfProcessing.
Solution
To create a dashed line border for a Table in RadPdfProcessing, follow these steps:
- Set the desired font style properties for the table.
- Create a
Borderobject with the desired thickness, style, and color. - Set the
Bordersproperty of the table'sDefaultCellPropertiesto the createdBorderobject. - Set the
Paddingproperty of the table'sDefaultCellPropertiesto the desired padding values. - Add rows and cells to the table and set the preferred width for each cell.
- Insert text into each cell using the desired font style properties.
- Use a FixedContentEditor to draw the table on the document page.
- Specify the desired dashed line style by setting the
StrokeDashArrayproperty of theGraphicPropertiesof theFixedContentEditor.
The following code snippet shows how to create a dashed line border for a table in RadPdfProcessing:

csharp
FontFamily fFamily = new FontFamily("Verdana");
RadFixedDocument fixedDocument = new RadFixedDocument();
Table table = new Table();
int thickness = 1;
RgbColor borderColor = new RgbColor(255, 0, 0);
Border b = new Border(thickness, BorderStyle.Single, borderColor);
table.DefaultCellProperties.Borders = new TableCellBorders(b,b,b,b);
table.DefaultCellProperties.Padding = new Thickness(2, 2, 2, 2);
TableRow r1 = table.Rows.AddTableRow();
TableCell firstCell = r1.Cells.AddTableCell();
firstCell.PreferredWidth = 200;
firstCell.Blocks.AddBlock().InsertText(fFamily, FontStyles.Normal, FontWeights.ExtraBold, "Telerik");
TableCell secondCell = r1.Cells.AddTableCell();
secondCell.PreferredWidth = 150;
secondCell.Blocks.AddBlock().InsertText(fFamily, FontStyles.Normal, FontWeights.Regular, "Document");
TableCell thirdCell = r1.Cells.AddTableCell();
thirdCell.PreferredWidth = 100;
thirdCell.Blocks.AddBlock().InsertText(fFamily, FontStyles.Normal, FontWeights.Bold, "Processing");
FixedContentEditor fixedEditor = new FixedContentEditor(fixedDocument.Pages.AddPage());
fixedEditor.GraphicProperties.IsFilled = true;
fixedEditor.GraphicProperties.StrokeDashArray = new double[] { 2,2};
fixedEditor.Position.Translate(10, 100);
fixedEditor.DrawTable(table);
string outputFilePath = @"..\..\output.pdf";
File.Delete(outputFilePath);
PdfFormatProvider provider = new PdfFormatProvider();
using (Stream output = File.OpenWrite(outputFilePath))
{
provider.Export(fixedDocument, output);
}
Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });
You can change the Borders property of the DefaultCellProperties to specify different border styles for each side of the cell or render a border only at the bottom:

csharp
table.DefaultCellProperties.Borders = new TableCellBorders(null, null, null,b);
Starting with Q3 2024 RadPdfProcessing offers Dotted, Dashed, and DashSmallGap border styles without the need to use the StrokeDashArray of the FixedContentEditor. With this update, the Dotted, Dashed, DashSmallGap, and Thick border lines are now exported from RadFlowDocument to RadFixedDocument as well.