SheetJS JS-XLSX example in Web Browser

xlsx.js example

Version: v0.14.3
Github: https://github.com/SheetJS/js-xlsx
NPM: https://www.npmjs.com/package/xlsx
CDN: https://cdn.jsdelivr.net/npm/xlsx@0.14.3/dist/xlsx.full.min.js

Test Online SheetJS xlsx.js

Select an Excel file and you will see the content:

Usage:

// <input type="file" onchange="parseExcelFile1(this)">
function parseExcelFile1(inputElement) {
  var files = inputElement.files || [];
  if (!files.length) return;
  var file = files[0];

  console.time();
  var reader = new FileReader();
  reader.onloadend = function(event) {
    var arrayBuffer = reader.result;
    // debugger

    var options = { type: 'array' };
    var workbook = XLSX.read(arrayBuffer, options);
    console.timeEnd();

    var sheetName = workbook.SheetNames
    var sheet = workbook.Sheets[sheetName]
    result1.innerHTML = XLSX.utils.sheet_to_html(sheet)
  };
  reader.readAsArrayBuffer(file);
}

Related Topics

SheetJS xlsx.js start tutorial
Using SheetJS xlsx.js in a browser(tutorial)
javascript manipulate Excel xlsx spreadsheet library
js read and parse excel xlsx document in client-side(front-end) Browser
js preview excel xlsx Workbook spreadsheet in web Browser
js render excel xlsx in web page




Javascript Excel(XLSX) libraries Demo