scalpel@labs: ~/glossary/merge-tables-into-one-file.mdx5 sections

Merge Several Web Tables into One CSV or Excel Workbook

Merging tables means exporting several tables from a page as one deliverable rather than one file each. A stacked CSV puts them one under another with a heading between; an XLSX workbook gives each table its own sheet; a rich copy pastes them all in one go.

extension: Scalpel Tablesupdated: 2026-08-14read_time: 2 min
less merge-tables-into-one-file.mdx

Why it matters

Many pages have two or more tables. If you want all of them in one file instead of clicking export for each table separately, merge saves time and keeps related data together.

The shape of the merge matters. A stacked CSV works when you want one plain-text file with all tables in sequence. An Excel workbook works better when you want to keep tables separate but in one file: each table on its own sheet, with its own formatting and structure.

How it works

Scalpel Tables offers three ways to combine tables:

Stacked CSV: All tables are written one under another. Between each pair, a blank row separates them and a row with the table name acts as a heading. The entire file is rectangular, every row padded to match the widest table so the CSV stays valid.

Excel workbook (XLSX): Each table becomes its own sheet inside one .xlsx file. Sheet names are generated from the table's context (a heading on the page, or a generic "Table 1", "Table 2"). If two tables would have the same name, the second is renamed with a number suffix to keep them unique.

Rich clipboard copy: Multiple tables are copied at once and can be pasted into Google Sheets, Excel, or Numbers. Each application reads the rich HTML format and pastes the tables sequentially.

What does not matter

You don't need to select all tables. The merge bar lets you tick only the ones you want. If a page has 10 tables and you need 3, pick those 3. Unchecked tables are skipped.

Also, the order doesn't matter for an Excel workbook. Sheets can be reordered inside the file after export. But for a stacked CSV, order matters because the file is a single sequence; tables are combined in the order they appear on the page.

Code example

Three tables from a page, each with different widths. After merge, the stacked CSV looks like:

Name,Age,City
Alice,28,New York
Bob,34,San Diego

Product,Price,Stock
Widget,9.99,100
Gadget,19.99,50
Doohickey,14.99,0

Month,Revenue
January,45000
February,52000
March,48000

Notice the blank row between tables and the way each section is padded to a consistent width (the widest table determines the column count). In Excel, those same three tables become a workbook with three sheets, one per table.

How Scalpel Tables shows it

When a page has two or more tables, a merge bar appears above the table list. Tick the checkboxes for the tables you want, choose your format (CSV stacked, Excel workbook, or copy to clipboard), and click the merge button. The export runs immediately.


Related:

Sources