-1
我用https://www.datatables.net例如 以下是我的jQuery導出HTML數據表到Excel
<script type="text/javascript">$(document).ready(function() {var data = <%=liveProjectData %>
$("#empdetails").html('<table id="example" class="table-responsive table-bordered table-hover" ></table>');
$("#example").dataTable({
"oTableTools": {
"sSwfPath": "http://cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf",
"aButtons": ["xls", "pdf", "print"]
},
"columns": [{
"title": "A"
}, {
"title": "B"
}, {
"title": "C"
}, {
"title": "D"
}, {
"title": "E"
}
],
"data": function() {
return $.map(data, function (attribute) {
return [
["<div class='badge badge-" + attribute.A + "'>" + attribute.A + "</div>", attribute.B, attribute.C, attribute.D, attribute.E, '<a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-ok" onclick="EditProjectDetails(' + attribute.A + ')">EDIT</a>'] ] })}()}) }); function EditProjectDetails(A) { window.location = "viewClientDetailToAdmin.aspx?A=" + A };
,我已經綁定數據以下的div
<div class="row"> <div class="col-md-12" id="empdetails"></div></div>
我在https://www.datatables.net/extensions/tabletools/ 讀到的數據表工具導出HTML表格數據爲pdf,excel
請幫我在Excel下載任何東西在HTML表格中我已經綁定了。
在此先感謝...