<table id="table">
<tr>
<td>1</td>
<td>2</td>
</tr>
</table>
<button id="but">save</button>
<script>
window.onload = function () {
but.onclick = function () {
window.open("data:application/vnd.ms-excel," + table.outerHTML);
}
}
</script>
не, первое чёт не прокатило
<div id="div">
<table>
<tr>
<td>1</td>
<td>2</td>
</tr>
</table>
</div>
<button id="but">save</button>
<script>
window.onload = function () {
but.onclick = function () {
window.open("data:application/vnd.ms-excel," + div.innerHTML);
}
}
</script>