Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

Migration guide for V0.2.1 to V1.0.0

Rohith Bhaskaran edited this page Dec 27, 2018 · 2 revisions

V0.2.1 was using protobi/js-xlsx which is a fork of SheetJS/js-xlsx with support for styles. SheetJS/js-xlsx does not support styles in the opensource version and protobi/js-xlsx is not actively maintained. So From V1.0.0 linways/table-to-excel uses guyonroche/exceljs for creating valid Excel files.

Breaking Changes

1. Changed the library file name

The name of the file is changed from xlsx_html_utils.min.js to tableToExcel.js. Since linways/table-to-excel no logner uses protobi/js-xlsx there is no need to include either ../dist/xlsx_html.full.min.js or ../lib/xlsx.core.min.js. You just need to include ../dist/tableToExcel.js instead.

2. Changed main method name

Since we no longer use js-xlsx, the main method for converting a HTML table to excel is changed to TableToExcel.convert. All the parameters are same. To migrate from v0.2.1 to v1.0.0, just replace XLSX.utils.html.save_table_as_excel with TableToExcel.convert. Example:

XLSX.utils.html.save_table_as_excel(document.getElementById("table1"), {
  name: "test.xlsx"
});

to

TableToExcel.convert(document.getElementById("table1"), {
  name: "test.xlsx"
});

3. Text rotation values

The value for text rotation changed to 0 to 90, -1 to -90 and vertical

4. Vertical alignment values

Vertical alignment- center changed to middle