我正在使用rainabba/jquery-table2excel將html表導出爲excel。單擊該按鈕時文件獲取下載,但是出色的報告文件或格式已損壞。請提示。文件格式或文件擴展名無效
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript" src="jquery-table2excel-master/dist/jquery.table2excel.min.js"></script>
<script type="text/javascript">
$(document).ready(function(e){
$("#myButton").click(function (e){
$(".mytable").table2excel({
name:"new File",
filename:"work",
//fileext:".xlsx"
});
});
});
</script>
</head>
<body>
<button id="myButton">Click To Download</button>
<table class="mytable" border="1">
<tr>
<th>new1</th>
<th>new2</th>
<th>new3</th>
<th>new4</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
<td>Data 4</td>
</tr>
</table>
</body>
</html>
http://stackoverflow.com/questions/38377796/export-html-table-to-excel-doesnt-open- in-office-2010/38379929#38379929 –
完成同樣的問題@AxelRichter – art