HTML Table to Excel: Copy Web Tables Without Broken Columns

2026-07-09

Typical use cases

Admin reports, third-party listings, Angular/React grids—viewable online but no Excel download. Manual copy often breaks columns and merged cells.

ComTools HTML to Excel (Tools/Excel/HtmlToExcel) parses HTML locally in the browser, then:

  • Copy to Excel (TSV + HTML clipboard)
  • Export Excel as .xlsx
  • Copy selection as SQL IN clause

Supported HTML

Type Examples
Standard tables <table>, <thead>, <tbody>, <tr>, <td>
Bootstrap grid .row + .col / .col-*
ngx-datatable datatable-* structures
ARIA tables role="table", role="gridcell"

Parsing is handled by excel-html-parse.js.

Steps

  1. On the target page, F12 → select the table node → Copy outerHTML.
  2. Open HTML to Excel, paste on the left.
  3. Preview on the right; try built-in samples.
  4. Then:
    • Copy to Excel → paste in Excel with Ctrl+V
    • Export Excel → download html-export.xlsx
    • Select cells → Copy as WHERE ININ (N'...', ...)

Why copy works better

Clipboard gets both:

  • text/plain — tab-separated values
  • text/html — a <table> fragment

Excel aligns columns more reliably than plain text alone.

IN clause from selection

Click, Shift-range, or Ctrl-click cells, then copy as IN:

IN (N'1001', N'1002', N'ORD-2024-001')

Paste into WHERE id IN (...) or refine with Text to SQL.

Scenarios

Scenario Approach
Report page scrape outerHTML → tool → export xlsx
Bootstrap admin UI copy the grid container
IDs for SQL select column → copy IN
Polish / database FormatSQL INSERT

Privacy

HTML is parsed locally (not uploaded). Export xlsx posts parsed rows to the server to build the file. For sensitive pages, prefer Copy to Excel only.

FAQ

Whole page HTML?
Copy only the table-related node to reduce noise.

Merged cells?
May duplicate values across cells—verify in Excel after export.

ngx-datatable not parsing?
Try datatable-body or an inner <table> fragment.

Copy vs export?
Quick analysis: copy. Merge, dedup, or file sharing: export.


中文版