Skip to content

Instantly share code, notes, and snippets.

@caot
Created July 4, 2014 00:12
Show Gist options
  • Save caot/c020bdbcf0fc9933b41e to your computer and use it in GitHub Desktop.
Save caot/c020bdbcf0fc9933b41e to your computer and use it in GitHub Desktop.
html table to excel
1. include the following two jaascript
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="https://raw.githubusercontent.com/caot/battatech_excelexport/master/Scripts/jquery.battatech.excelexport.js"></script>
2. Add the folling behind the targeted table with id = "tblExport"
<script>
$(document).ready(function () {
$("#btnExport").click(function () {
$("#tblExport").btechco_excelexport({
containerid: "tblExport"
, datatype: $datatype.Table
});
});
});
</script>
<div><button id="btnExport">Export to excel</button></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment