export html table to csv

后端 未结 8 2038
走了就别回头了
走了就别回头了 2020-12-07 18:20

I am trying to add a feature of csv download option in my website. It should convert the html table present in the website in to csv content and make it downloadable. Ive be

8条回答
  •  情深已故
    2020-12-07 18:58

    There is a very easy free and open source solution at http://jordiburgos.com/post/2014/excellentexport-javascript-export-to-excel-csv.html

    First download the javascript file and sample files from https://github.com/jmaister/excellentexport/releases/tag/v1.4

    The html page looks like below.

    Make sure the the javascript file is in the same folder or change the path of the script in the html file accordingly.

    
    
        Export to excel test
        
        
    
    
        

    ExcellentExport.js

    Check on jordiburgos.com and GitHub.

    Test page


    Export to Excel
    Export to CSV
    Column 1 Column "cool" 2 Column 3
    100,111 200 300
    400 500 600
    Text More text Text with new line

    It is very easy to use this as I have tried most of the other methods.

提交回复
热议问题