Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
TableExport is an open-source JavaScript library that exports HTML tables to xlsx, xls, csv, and txt files entirely in the browser, without any server-side processing. Developed by the GitHub user clarketm and hosted at tableexport.travismclarke.com, it is licensed under Apache-2.0 and can be installed via npm, Bower, or loaded from a CDN. The library accepts one or more HTML table elements and produces downloadable spreadsheet files through auto-generated or custom export buttons.
TableExport is a client-side library that takes HTML table markup as input and generates downloadable files in four spreadsheet formats: xlsx, xls, csv, and txt. It runs in any modern browser and requires FileSaver.js for file saving; jQuery and Bootstrap are optional dependencies that enable extra convenience methods and built-in button styling. The library is created by clarketm (Travis Clarke) and is distributed as a standalone script or as an npm package named tableexport.
exportButtons is true, TableExport generates a button for each selected format; with bootstrap: true, these buttons use Bootstrap's btn, btn-default, and btn-toolbar classes.id attribute or custom string), sheet name, button position (top or bottom), RTL worksheet direction, and row or column exclusion via ignoreRows and ignoreCols.getExportData, export2file, getFileSize, update, reset, and remove so developers can build fully custom export workflows or modify the instance after creation.ignoreCSS and emptyCSS prototype settings let you exclude or blank cells by matching any CSS selector or array of selectors.$("table").tableExport() directly.formatConfig prototype object allows per-format changes to class names, button content, MIME type, separator, and file extension (for example, changing CSV's MIME type).$("table").tableExport() syntax and the optional Bootstrap styling that matches existing jQuery plugin ecosystems.bootstrap: true.getExportData and export2file to create custom download buttons that trigger exports with specific MIME types and filenames.The setup involves including FileSaver.js and tableexport.js (plus xlsx.core.js if you need xlsx export) via script tags or a package manager. Then you call new TableExport(document.getElementsByTagName("table")) or the jQuery variant $("table").tableExport(), optionally passing configuration properties. TableExport reads the table's header, footer, and body rows, applies any ignore or empty rules, and attaches download buttons that convert the table content to the chosen file format on click.
TableExport is free to use and distributed under the Apache License 2.0. There are no paid tiers or premium features; the source code is available on GitHub and via npm, Bower, and unpkg CDN.
Yes, TableExport is open source and released under the Apache-2.0 License. You can use it in commercial and personal projects without paying any licensing fees, and the full source is available on GitHub.
TableExport can export HTML tables to xlsx, xls, csv, and txt. By default it exports xlsx, csv, and txt; you can change the formats option to include xls or restrict to only certain filetypes. XLSX support requires including the optional SheetJS xlsx.core.js file.
No, jQuery is optional. TableExport works with plain JavaScript using the new TableExport constructor, and it also provides a jQuery plugin method $("table").tableExport() when jQuery is present. The library is designed to function fully without jQuery.
To use the xlsx format, you must include the third-party library xlsx.core.js from SheetJS before FileSaver.js and tableexport.js in your HTML. However, if you install TableExport via Bower or npm, xlsx support is bundled and does not require a separate script tag.
TableExport works on Chrome, Firefox, Opera, and Safari across Android, iOS, Mac OSX, and Windows, and on Internet Explorer on Windows. Very old browsers — Chrome below 20, Firefox below 13, Opera below 12.10, IE below 10, and Safari below 6 — require the Blob.js polyfill from the provided fork.
