How to Merge Tables in Word: 2 Effective Methods

2026-12-03 09:48:09 Carol Liu
AI Summarize:
ChatGPT
ChatGPT ✓
Claude ✓
Grok ✓
Perplexity ✓
Quick
Quick
Concise overview
Highlights
Key takeaways
Detailed
Structured explanation
Brief
One sentence summary
Summarize |

How to Merge Tables in Word without Effort

When a Word document contains separate tables for different months, quarters, or data groups, you may need to combine them into one table for easier reading and analysis. Knowing how to merge tables in Word can save time, especially when working with long reports.

This guide will walk you through two practical methods step by step, from merging tables directly in Word to automating the process with Python. By the end, you'll know how to combine tables efficiently and choose the method that works best for your needs.

How to Merge Tables in Word Manually: 2 Ways

Microsoft Word provides a simple way to merge two adjacent tables. You can combine them by deleting the paragraph mark between them or copy rows from one table to another.

1. Delete the Paragraph Mark Between Tables

The quickest way to merge two tables in Word is to press the Delete key to remove the paragraph mark between them. Word will automatically join the tables, but any text or images between them will also be deleted. To avoid losing content, move the tables next to each other first.

Here are the detailed steps to combine two tables using the Delete key:

  • Step 1. Open your Word document and go to the Home tab.
  • Step 2. Click Show/Hide in the Paragraph group to display formatting marks. This makes the paragraph mark between the two tables visible.

Display Formatting Marks in Word Documents

  • Step 3. Place the cursor at the beginning of the second table and select any unnecessary paragraph marks or blank lines between the tables.
  • Step 4. Press Delete on your keyboard.

Note: Make sure to press Delete, instead of Backspace, as the two keys perform different actions in this operation.

2. Copy Rows from One Table to Another

If deleting the paragraph mark does not work for your document, you can manually move the rows from one table into another. This method is also useful when you only need to merge specific rows rather than the entire table.

  • Step 1. Click inside the first table and add enough blank rows at the bottom.
  • Step 2. Select the rows you want to move from the second table and press Ctrl + C to copy them.
  • Step 3. Select the first empty cell in the new rows of the first table and press Ctrl + V to paste the copied content.

How to Merge Tables in Word Using Python

The manual methods above work well for occasional edits. But if you often need to merge multiple tables in a Word document or repeat the task frequently, doing it by hand can be time-consuming. Instead, Python offers a way to automate this task and add table merging to your document-processing workflow.

1.Install Free Spire.Doc for Python

Free Spire.Doc for Python is a free Python library for working with Word documents. It supports creating, reading, editing, and saving Word files in formats such as DOC and DOCX. You can use it to access document elements, modify paragraphs and tables, and automate common document-processing tasks.

To get started, install the library with pip:

pip install Spire.Doc.Free

After installation, import the required modules to load a Word document and work with its tables.

2. Merge Tables While Preserving Original Formatting

With Free Spire.Doc for Python, you can merge two tables by cloning the rows from the second table and adding them to the first. The Clone() method creates a copy of each row, while Rows.Add() appends the copied rows to the first table.


from spire.doc import *
from spire.doc.common import *

# Define input and output files
inputFile = "sample.docx"
outputFile = "merged_preserve_format.docx"

# Create a Document instance
doc = Document()

# Load the Word document
doc.LoadFromFile(inputFile)

# Get the first section
section = doc.Sections[0]

# Get the first and second tables
table1 = section.Tables[0]
table2 = section.Tables[1]

# Copy rows from the second table to the first table
for i in range(table2.Rows.Count):
    table1.Rows.Add(table2.Rows[i].Clone())

# Remove the second table
section.Tables.Remove(table2)

# Save the result document
doc.SaveToFile(outputFile, FileFormat.Docx2013)
doc.Close()

Merge Two Tables in Word While Keeping Their Format

Tip: It is recommended to use custom cell formatting, such as borders and shading, instead of Word's built-in table styles. Once merged, both sets of rows belong to the same table and cannot retain separate built-in styles.

3. Merge Tables with Consistent Formatting

When merging two tables, you may want them to share the same column widths and formatting. You can use the first table as a reference and apply its layout to the rows copied from the second table.

The following code standardizes column widths, border styles, and border colors. It skips the second table's header row and applies the first table's corresponding data-row formatting to the copied rows.

from spire.doc import *
from spire.doc.common import *

# Define input and output files
inputFile = "sample.docx"
outputFile = "merged_uniform_format.docx"

# Copy border formatting from one cell to another
def copy_cell_borders(source_cell, target_cell):
    source_borders = source_cell.CellFormat.Borders
    target_borders = target_cell.CellFormat.Borders

    for side in ["Top", "Bottom", "Left", "Right"]:
        source_border = getattr(source_borders, side)
        target_border = getattr(target_borders, side)

        target_border.BorderType = source_border.BorderType
        target_border.LineWidth = source_border.LineWidth
        target_border.Color = source_border.Color


# Create a Document instance
doc = Document()

# Load the Word document
doc.LoadFromFile(inputFile)

# Get the first section
section = doc.Sections[0]

# Get the first and second tables
table1 = section.Tables[0]
table2 = section.Tables[1]

# Get the column widths of the first table
column_count = table1.Rows[0].Cells.Count
column_widths = []

for i in range(column_count):
    width = table1.Rows[0].Cells[i].GetCellWidth()
    column_widths.append(width)

# Use the first data row of the first table as the formatting template
template_row = table1.Rows[1]

# Copy rows from the second table, excluding the header row
for i in range(1, table2.Rows.Count):
    new_row_index = table1.Rows.Add(table2.Rows[i].Clone())
    new_row = table1.Rows[new_row_index]

    # Apply the border formatting of the first table
    for j in range(column_count):
        copy_cell_borders(template_row.Cells[j], new_row.Cells[j])

# Remove the second table
section.Tables.Remove(table2)

# Set the same width for each column
for i in range(column_count):
    table1.SetColumnWidth(i, column_widths[i], CellWidthType.Point)

# Save the result document
doc.SaveToFile(outputFile, FileFormat.Docx2013)
doc.Close()

Combine Tables in Word with Consistent Formatting

Note: The code assumes that the first row of the second table is a header row and skips it during the merge. If your tables do not have header rows, change the starting index of the loop from 1 to 0. If you also need to standardize other formatting, such as font styles or cell shading, add the corresponding formatting properties to the code.

Also read: Python: Change or Remove Borders for Tables in Word

Conclusion

In this guide, we have explained two methods to merge tables in Word documents. You can combine tables manually by deleting the paragraph mark between adjacent tables or copying rows from one table to another. If you need to automate the process, Python can help you combine table rows and standardize column widths. To try this approach, use Free Spire.Doc for Python to get started with Word table editing.

FAQs about Merging Tables in Word

Why Can't I Merge Two Tables in Word?

The tables may not be adjacent, or a paragraph mark, page break, or section break may separate them. Turn on formatting marks and check the space between the tables.

You may like: How to Remove Page Breaks in Word (4 Easy Methods)

Can I Merge Tables with Different Numbers of Columns?

Yes, but the merged table may have an inconsistent structure because rows with different numbers of cells are not automatically adjusted to the same column count.

Can I Merge Tables Without Losing Formatting?

Yes. Using the Delete key to remove the paragraph mark between adjacent tables can preserve their original formatting, including built-in table styles. However, when copying rows manually or using Python to merge tables, the rows added to the first table cannot retain a separate built-in table style. Custom cell formatting, such as borders and shading, can still be preserved.

How Do I Merge Two Tables Side by Side in Word?

To place two tables side by side, first create a larger table with two columns. Then copy each original table into a separate column of the new table. This lets you arrange the two tables horizontally without merging their rows.


Also read: