Change Table Width to Fit Document Width - Automatically
You probably know this behavior from web browsers, such as FireFox or Microsoft Internet Explorer. You have a table that is 100% the width of a document. As you resized the window in which the document is displayed, the document size changes. The change in width is directly proportional to the width of the window. In this sample application, I am going to show you how to change the width of a table in sync with the width of a document. Sounds complicated, but it is not. The screenshot that…

You probably know this behavior from web browsers, such as FireFox or Microsoft Internet Explorer.
You have a table that is 100% the width of a document. As you resized the window in which the document is displayed, the document size changes. The change in width is directly proportional to the width of the window.
In this sample application, I am going to show you how to change the width of a table in sync with the width of a document.
Sounds complicated, but it is not. The screenshot that accompanies the tutorial will make things clearer.
Download the sample from GitHub and test it on your own.
Download and Fork This Sample on GitHub
We proudly host our sample code on github.com/TextControl.
Please fork and contribute.
Requirements for this sample
- Visual Studio 2012 or better
- TX Text Control .NET for Windows Forms (trial sufficient)
Windows Forms
Text Control combines the power of a reporting tool and an easy-to-use WYSIWYG word processor - fully programmable and embeddable in your Windows Forms application. TX Text Control .NET for Windows Forms is a royalty-free, fully programmable rich edit control that offers developers a broad range of word processing features in a reusable component for Visual Studio.
Related Posts
Official TX Text Control .NET Sample Applications Are Now Hosted on GitHub
This article gives a quick overview of the new repositories, their structure and our plans for the future.
Reporting: Merging MS Word Documents with DocVariables
TX Text Control supports all MS Word fields including the typical merge fields, content control fields, legacy form fields or special fields such as DOCVARIABLE. All of those fields can be found…
ASP.NETWindows FormsASP.NET Core
Splitting Tables at Bookmark Positions and Cloning Table Headers
This article shows how to split tables at bookmark positions and how to clone table headers in TX Text Control .NET for Windows Forms and TX Text Control .NET Server.
Loading and Processing Excel XLSX Spreadsheet Tables into TX Text Control…
TX Text Control provides a powerful API to load and process Excel spreadsheet tables in .NET applications. This article shows how to load an Excel file and process the tables using TX Text Control…
Text to Table and Table to Text in TX Text Control and C#
TX Text Control provides powerful table features and also full access to text formatting which can be used to create tables from text and vice versa. This article shows how to convert text to…