TableExport

The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.

GitHub release Build Statusarrow-up-right Downloads License

Docs

Getting Started

Install manually using <script> tags

To use this library, include the FileSaver.jsarrow-up-right library, and TableExportarrow-up-right library before the closing <body> tag of your HTML document:

<script src="FileSaver.js"></script>
...
<script src="tableexport.js"></script>

Install with Bower

Install with npm

CDN

Dependencies

Required:

Optional:

Add-Ons:

In order to provide Office Open XML SpreadsheetML Format ( .xlsx ) support, you must include the following third-party library in your project before both FileSaver.jsarrow-up-right and TableExportarrow-up-right.

Including xlsx.core.js is NOT necessary if installing with Bower or npm

Older Browsers:

To support legacy browsers ( Chrome < 20, Firefox < 13, Opera < 12.10, IE < 10, Safari < 6 ) include the Blob.jsarrow-up-right polyfill before the FileSaver.jsarrow-up-right script.

Including Blob.js is NOT necessary if installing with Bower or npm

Usage

JavaScript

To use this library, simple call the TableExportarrow-up-right constructor:

Additional properties can be passed-in to customize the look and feel of your tables, buttons, and exported data.

Notice that by default, TableExport will create export buttons for three different filetypes xls, csv, txt. You can choose which buttons to generate by setting the formats property to the filetype(s) of your choice.

Note: to use the xlsx filetype, you must include js-xlsxarrow-up-right; reference the Add-Ons section.

Properties

Methods

TableExport supports additional methods (getExportData, update, reset and remove) to control the TableExportarrow-up-right instance after creation.

Settings

Below are some of the popular configurable settings to customize the functionality of the library.

CSS

TableExportarrow-up-right packages with customized Bootstraparrow-up-right CSS stylesheets to deliver enhanced table and button styling. These styles can be enabled by initializing with the bootstrap property set to true.

When used alongside Bootstrap, there are four custom classes .xlsx, .xls, .csv, .txt providing button styling for each of the exportable filetypes.

Browser Support

Chrome

Firefox

IE

Opera

Safari

Android

-

-

iOS

-

-

-

Mac OSX

-

Windows

A full list of browser supportarrow-up-right can be found in the FileSaver.jsarrow-up-right README. Some legacy browsersarrow-up-right may require an additional third-party dependency: Blob.jsarrow-up-right

Examples

Customizing Properties

Customizing Settings

Miscellaneous

Skeletons

License

TableExportarrow-up-right is licensed under the terms of the Apache-2.0arrow-up-right License

Going Forward

TODOs

Credits

Special thanks the the following contributors:

Last updated

Was this helpful?