In this post, we will introduce you with 2 workarounds you can take when an applied table style changes your preferred alignment.
First, here is our case. If we center a table in Word document, and then apply a specific table style for it, we find our preferred alignment missing. Instead, the table now aligns to left.
Certainly, we want to keep the previous alignment style even a new table style is employed. For this reason, this article will offer 2 solutions for you to fix the problem.
Method 1: Modify the Table Style
- First off, select the specific table style in style library.
- Then click “More” button.
- Next on the menu, choose “Modify Table Style”.
- In the “Modify Style” dialog box, click “Format” button.
- Then choose “Table Properties” to open the same name dialog box.
- Now click on “Table” tab first.
- Then select “Center” for alignment.
- Next click “OK” both in “Table Properties” and “Modify Style” dialog boxes.
Now you have changed the table style. All tables with this style shall take the center alignment in the future.
Method 2: Run Word Macro
Now and then, there can be a number of tables with different styles applied. Obviously, it takes long time like forever to alter the style template one by one. Then it’s time to take use of the almighty Word macro.
- First and foremost, press “Alt+ F11” to open the VBA editor.
- Then click “Insert” and choose “Module” to insert a new one under “Normal” project.
- Next double click on the new module so as to trigger the editing area.
- Now paste the following codes:
Sub CenterAlltables() Dim objTable As Table Dim objDoc As Document Set objDoc = ActiveDocument With objDoc For Each objTable In .Tables objTable.Rows.Alignment = wdAlignRowCenter Next objTable End With End Sub
- Lastly, click “Run”.
Here is the result:
Comparison of 2 Methods
|Method 1: Modify the Table Style||1. You can choose to let the modification saved only in one document or on a template.
2. Best applied to all tables with the same style in a document
|If there are tables with different styles in one document, you will have to change default settings of each style separately.|
|Method 2: Run Word Macro||1. No need to alter the style
2. You can center tables in batches.
|In future documents in need the change of table alignment, you have to run the macro again.|
Be Conscious of File Damage
During our daily use, most users must have encountered with the freeze of Word. Generally, you have to wait for a while and restart the application. There may be or may not be files saved for you before Word stopping working. If there is no recovery version of your file, the only workaround is to get a Word docx corruption recovery tool.
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including Excel data damage repair tool and pdf repair software products. For more information visit www.datanumen.com