import data from html to excel
html to excel converter free download
export html table to excel with formatting
html data to excel
export html form data to excel using javascript
copy html table to excel
html to excel php
export html table data to excel using jquery
A Pen by Edward Lance Lorilla on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<button @click="tableToExcel('table', 'Lorem Table')">export </button> | |
<table ref="table" id="loremTable" summary="lorem ipsum sit amet" rules="groups" frame="hsides" border="2"> | |
<caption>lorem ipsum</caption> | |
<colgroup align="center"></colgroup> | |
<colgroup align="left"></colgroup> | |
<colgroup span="2" align="center"></colgroup> | |
<colgroup span="3" align="center"></colgroup> | |
<thead valign="top"> | |
<tr> | |
<th>id</th> | |
<th>Name</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr> | |
<td>lorem ipsum</td> | |
<td>sit amet</td> | |
</tr> | |
</tbody> | |
</table> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
data(){ | |
return{ | |
uri :'data:application/vnd.ms-excel;base64,', | |
template:'<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>', | |
base64: function(s){ return window.btoa(unescape(encodeURIComponent(s))) }, | |
format: function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) } | |
} | |
}, | |
methods:{ | |
tableToExcel(table, name){ | |
if (!table.nodeType) table = this.$refs.table | |
var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML} | |
window.location.href = this.uri + this.base64(this.format(this.template, ctx)) | |
} | |
} | |
}).$mount('#app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.js"></script> |
2 Comments
>>>>> Download Full
Edward Lance Lorilla >>>>> Download LINK
>>>>> Download Now
Edward Lance Lorilla >>>>> Download Full
>>>>> Download LINK