0
$("#export-excel").live('click', function(e) {
    window.open('data:application/vnd.ms-excel,' + $('#table-div').html());
    e.preventDefault();
});

This code keeps grabbing the html tags when I export, so in the excel doc it comes out as <table><tbody>.....

TylerH
  • 20,799
  • 66
  • 75
  • 101
Tegro
  • 1
  • 1

1 Answers1

1

You can't just set the content type to Excel format and then expect the code to convert itself to Excel.. You actually have to convert the HTML code to the required formatting of Excel.

Have a look at: How can I export tables to excel from a webpage

Community
  • 1
  • 1
Philip
  • 2,888
  • 2
  • 24
  • 36