Hi,
I just want to export the HTML table content to Excel by using JavaScript.
But i dont want to use Active X control. Pls suggest me a code.
Thanks,
Pandian
Export the HTML table content to Excel by using JavaScript
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

White Evaln26 reputationPosted Aug 27, 2012, 7:23 PM EDT
I think below code can help you: var tableToExcel = (function() { var uri = 'data:application/vnd.ms-excel;base64,' , template = '{worksheet}{table}' , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) } , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } return function(table, name) { if (!table.nodeType) table = document.getElementById(table) var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML} window.location.href = uri + base64(format(template, ctx)) } })() Details can be:https://gist.github.com/1031969 http://stackoverflow.com/questions/6566831/how-to-export-html-table-to-excel-using-javascriptchellappan pandiarajan79 reputationPosted Aug 28, 2012, 2:14 AM EDT