How to export an HTML table as a .xlsx file

后端 未结 4 901
慢半拍i
慢半拍i 2020-12-03 15:37

I have a question about exporting an HTML table as an xlsx file. I did some work and now I can export it as an xls, but I

4条回答
  •  一向
    一向 (楼主)
    2020-12-03 15:51

    A great client-side tool for exporting html tables to xlsx, xls, csv, or txt is TableExport by clarketm (me). It is a simple, easy-to-implement, full-featured library with a bunch of configurable properties and methods.

    Install

    $ npm install tableexport
    

    Usage

    TableExport(document.getElementsByTagName("table"));
    
    // OR using jQuery
    
    $("table").tableExport(); 
    

    Documentation

    Sample apps to get you started

    • TableExport + RequireJS
    • TableExport + Flask
    • TableExport + Webpack 1
    • TableExport + Angular 4 + Webpack 2

    Check out the compendious docs or just head over to TableExport on Github for a full list of features.

提交回复
热议问题