I have a html page with a table which is populated dynamically. I need to put 2 buttons below it which enables exporting the table structure data to Excel and PDF.
What is the best/easiest approach to implement this?
I will prefer some Javascript/jQuery solution. I have seen DocRaptor , but I think its a paid service. I need something similar which works on IE8 browser. Please Help !
TableTools is a plug-in for the DataTables HTML table enhancer, which adds a highly customisable button toolbar to a DataTable. Key features include:
$("button").click(function () {
var str="";
$('tr').each(function() {
$(this).find('td').each(function() {
str=str+$(this).html()+"\t";
});
str=str+"\n";
});
alert(str);
window.open('data:application/vnd.ms-excel,' + encodeURIComponent(str));
});
FPDF是一个允许生成PDF文件的PHP类
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.