Use cases

Export an HTML table as CSV

Users don't want a screenshot of the table, they want the table — in a spreadsheet. The usual fix re-implements the query server-side and exports from the database, which drifts from the filtered, sorted view the user is actually looking at. The truthful export of what's on screen is the one taken from the screen.

CSV comes from the DOM, not a re-query

The rows, the applied filters, the sort order — the export is exactly the state the user sees, because it is read from the rendered table.

Ask for both shapes at once

One capture can return the CSV and a PNG or PDF of the same table — the data for the spreadsheet, the picture for the slide.

Delivery included

Hand the files to the user, or have them posted to your endpoint with params attached — useful when exports need an audit trail.

Questions people ask

Does it handle virtualized tables?
The capture reads what is in the DOM. Fully virtualized grids that only mount visible rows export the mounted rows — the honest answer for any DOM-based approach — so render the full set (most libraries have an export mode) when you need every row.
What about merged headers and formatting?
CSV is values; the visual structure is what the PNG/PDF of the same capture is for.