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>.....

1
  • There is also this library excelbuilderjs.com. You might find it helpful. Commented Mar 4, 2016 at 18:09

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.