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
- On the target page,
F12→ select the table node → Copy outerHTML. - Open HTML to Excel, paste on the left.
- Preview on the right; try built-in samples.
- Then:
- Copy to Excel → paste in Excel with
Ctrl+V - Export Excel → download
html-export.xlsx - Select cells → Copy as WHERE IN →
IN (N'...', ...)
- Copy to Excel → paste in Excel with
Why copy works better
Clipboard gets both:
text/plain— tab-separated valuestext/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 | Format → SQL 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.
Related
- Excel Format
- SQL IN from text
- Legacy posts:
html-table-copy-to-excel,html-bootstrap-to-excel
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.