2 Workarounds when an Applied Table Style Changes the Preferred Alignment

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.Table Alignment Changes

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

  1. First off, select the specific table style in style library.
  2. Then click “More” button.Select Style->Click "More"
  3. Next on the menu, choose “Modify Table Style”.Choose "Modify Table Style"
  4. In the “Modify Style” dialog box, click “Format” button.
  5. Then choose “Table Properties” to open the same name dialog box.Click "Format"->Choose "Table Properties"
  6. Now click on “Table” tab first.
  7. Then select “Center” for alignment.
  8. Next click “OK” both in “Table Properties” and “Modify Style” dialog boxes.Click "Table"->Choose "Center">Click "OK" Twice

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.

  1. First and foremost, press “Alt+ F11” to open the VBA editor.
  2. Then click “Insert” and choose “Module” to insert a new one under “Normal” project.Click "Normal"->Click "Insert"->Choose "Module"
  3. Next double click on the new module so as to trigger the editing area.
  4. 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
  1. Lastly, click “Run”.Paste Codes->Click "Run"

Here is the result:Effect of Running Macro

Comparison of 2 Methods

Methods Advantages Disadvantages
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.

Author Introduction:

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

Comments are closed.