Answer the question
In order to leave comments, you need to log in
Why does the encoding crash when forming a table in excel?
<a href="#" id="tableName" onclick="downloadFile()">Импорт данных в Excel</a>
<br /><br />
<div id="tableWrap">
<table width="100%" border="1" cellpadding="3px" style="font-size: 12px; border-collapse: collapse; border: 1px solid gray;">
<tr>
<th>Наименование</th>
<th>Количество</th>
<th>Стоимость</th>
</tr>
</table>
</div>
<script type="text/javascript">
function downloadFile(){
var url='data:application/vnd.ms-excel,' + encodeURIComponent($('#tableWrap').html())
location.href=url
return false
}
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question