In this article, we would like to share 2 easy methods to adjust contents to fit in cells in your Word table.
When deal with a table in Word document, it’s hard to ensure all table cells stay in fixed size. Normally, with more words input in a cell, it will automatically wrap text. Below is an example:
This is surely not eye-catching. How about finding ways to fix a table size but make contents fit it?
Following are 2 ways available:
Method 1: Set a Table One Time
- At first, click the plus sign on the upper-left corner of the table to select it.
- Then, right click on the selected table.
- Next choose “Table Properties”.
- Now in the “Table Properties” dialog box, click “Cell” tab first.
- Then click “Options” on the right-down corner of the box.
- Now you will open the “Cell Options” dialog box. Go to “Options” part, and clear “Wrap text” box.
- And check “Fit text” box instead.
- Then click “OK”.
- And remember to click “OK” in “Table Properties” dialog box, too.
Now the contents layout will change accordingly. Here is what you will get:
Method 2: Utilize VBA Codes
The VBA editor in Word allows you to type codes to customize your own Word features to get jobs done in a quick and neat way. So you can comfortably use codes to make the miracle happen.
- First and foremost, click “Developer” tab. If you don’t have it already, you can refer to this article: How to Insert Background Music into Your Word Document
- Then, click “Visual Basic” to open VBA editor.
- In VBA editor, find the project with document name after it and click “ThisDocument”.
- Next, click “Insert” on toolbar.
- And choose “Module” on the menu.
- Now you will open the editing area, just paste codes there:
Sub AutoFitTextForAllTableCells() ' Check if there are any tables in the document If ActiveDocument.Tables.Count > 0 Then Dim objTable As Table Dim objCell As Cell ' Process each cell in each table and set the options accordingly For Each objTable In ActiveDocument.Tables For Each objCell In objTable.Range.Cells objCell.WordWrap = False objCell.FitText = True Next Next Else MsgBox("There is no table in this document!") End If End Sub
Prepare for the Impending Failure
Incidents will always catch you off guard. So the best way is to take time and make preparation. Precautious measures can include backing up files and shelling out some money to get a corrupt Word doc recovery tool. Since data loss can happen to anyone at anyplace, it’s time to do something.
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including Excel data error fix tool and pdf repair software products. For more information visit www.datanumen.com