GithubHelp home page GithubHelp logo

excel2table's Introduction

Excel2table

npm version

Excel2table is a library that will help you to render an Excel file as an HTML table. It uses https://github.com/dhtmlx/excel2json for Excel parsing.

result

How to use

import {render} from "excel2table";
render(html_container, data, config);

The parameters of the function are the following:

  • html_container - a CSS locator or an HTML element
  • data - a file object or a data blob
  • config - optional, a configuration object { worker, scale }, where
    • worker: string - an URL for a web worker; CDN is used by default
    • scale: boolean - defines whether Excel scale is shown
    • sheets: boolean - defines if sheet selector need to be rendered or not

License

MIT

excel2table's People

Contributors

mafanya23 avatar mkozhukh avatar stanislav-wolski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

excel2table's Issues

rendering a blob gives RuntimeError: unreachable

Hi,
I was trying to render a xlsx as a blob but without success.
In every attempt this RuntimeError: unreachable error shows up:
Captura de Tela 2020-07-09 às 13 37 28

here is what i tried to do:

import { render } from 'excel2table';
function init() {
  const url = '[url_to_xlsx_file]';
  
  getBlob(url).then((blob) => { render('#xlsx-preview', blob, { scales: true }) });
}

async function getBlob(url) {
  const blob = await fetch(url).then(r => r.blob());
  return blob; // Blob {size: 3410648, type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}
}
init();

i tried to render a URL.createObjectURL(blob) too, but it gave me the same error.

It's something that i'm doing wrong?

Thanks.
Regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.