jQuery Table to CSV export

前端 未结 5 2196
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 13:18

I\'m using the jQuery Table to CSV Plugin. I\'ve altered the popup so that it tells the browser to download a CSV file.

It was:

function popup(data)         


        
5条回答
  •  鱼传尺愫
    2020-11-27 14:04

    Found a solution that works (with help from http://www.topsemtips.com/2008/11/save-html-table-to-excel-using-jquery/):

    I changed the function to:

    function popup(data) {
        $("#main div.inner").append('
    '); $("#exportdata").val(data); $("#exportform").submit().remove(); return true; }

    And created the file export.php:

    
    

    Update: A more IE7 friendly version:

    
    

提交回复
热议问题