Export Tabular Data To Excel – table2excel.js

Category: Javascript , Table | January 11, 2020
Views Total:4,638 views
Official Page:Go to website
Last Update:January 11, 2020


Export Tabular Data To Excel – table2excel.js


A vanilla JavaScript Table To Excel exporter that enables the user to download tabula data as an Excel file (xls).

See also:

How to use it:

1. Download and import the minified version of the table2excel.js library into the document.

<script src="table2excel.min.js"></script>

2. Convert the HTML table into an Excel file.

<table class="table table-dark" id="example">
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
      <th scope="row">1</th>
      <th scope="row">2</th>
      <th scope="row">3</th>
      <td>the Bird</td>
let t2e = new Table2Excel('#example');

3. Export and download the Excel file.


4. Customize the file name.

let t2e = new Table2Excel('#example', {
    filename: "cssscript"

5. Define the table rows (CSS class) to ignore.

let t2e = new Table2Excel('#example', {
    exlude: 'ignore'

You Might Be Interested In:

Leave a Reply