Understanding TableCell Width, Borders and Text Distances
A TableCell object has a border, a text distance and a total width. These values are interacting and I thought to shed some light on this interaction. The different properties in detail: TableCell.Width This property gets or sets, in twips, the width of the cell. TableCell.CellFormat.BottomTextDistance Gets or sets, in twips, the distance between the table cell's bottom border and its text. TableCell.CellFormat.TopTextDistance Gets or sets, in twips, the distance between the table cell's top…

A TableCell object has a border, a text distance and a total width. These values are interacting and I thought to shed some light on this interaction.
The different properties in detail:
- TableCell.Width
This property gets or sets, in twips, the width of the cell. - TableCell.CellFormat.BottomTextDistance
Gets or sets, in twips, the distance between the table cell's bottom border and its text. - TableCell.CellFormat.TopTextDistance
Gets or sets, in twips, the distance between the table cell's top border and its text. - TableCell.CellFormat.LeftTextDistance
Gets or sets, in twips, the distance between the table cell's left border and its text. - TableCell.CellFormat.RightTextDistance
Gets or sets, in twips, the distance between the table cell's right border and its text. - TableCell.CellFormat.BottomBorderWidth
Gets or sets the width of the table cell's bottom border. - TableCell.CellFormat.TopBorderWidth
Gets or sets the width of the table cell's top border. - TableCell.CellFormat.LeftBorderWidth
Gets or sets the width of the table cell's left border. - TableCell.CellFormat.RightBorderWidth
Gets or sets the width of the table cell's right border.
The TableCell.Width property is completely independent from all other settings. In other words, the width of a TableCell stays constant even if you change the border width or the distance from the text to the border.
The following illustration shows the different values of a TableCell:

As you can see, the text distance is measured from the inner border to the text and the width is measured from the left outer border to the right outer border.
Related Posts
Windows FormsGetting StartedTutorial
Windows Forms Tutorial: Create Your First Windows Forms C# Application
This tutorial shows how to create your first Windows Forms application with C# using TX Text Control .NET for Windows Forms in Visual Studio 2022.
How to Mail Merge MS Word DOCX Documents in ASP.NET Core C#
Mail merge is the process of merging data, such as Json or IEnumerable objects, into a template document, such as a DOC or DOCX file. This tutorial is a walkthrough of the steps necessary to…
Creating an Angular Document Editor Application with a Node.js WebSocket Server
This tutorial shows how to create an Angular application that uses the Document Editor with a Node.js WebSocket server.
Adding SVG Watermarks to Documents
This article shows how to add SVG images to document section headers that repeat automatically on each page. This watermark will be inserted vertically and horizontally centered on each section page.
Using MailMerge in ASP.NET Core 6 Web Applications
This article shows how to use the TX Text Control ASP.NET MailMerge class to merge templates with JSON data within a .NET 6 application in Visual Studio 2022.