A Free jQuery Plugin with table2excel is Export Html Table To Excel Spreadsheet jQuery Plugin. This plugin is simple to useful jQuery plugin which allows for exporting Html table data to an Excel file sheet.
Table of Contents
Alternative plugins:
How to use:
Include jQuery library after the jQuery table2excel plugin in the Html web page.
<script src="jquery/1.11.1/jquery.min.js"></script>
<script src="src/jquery.table2excel.js"></script>
Create an ‘Export’ button to export table data to an Excel file manually.
<button>Export</button>
Call the Function of plugin on the table and pass the following options.
$("button").click(function(){
$("#table2excel").table2excel({
// exclude CSS class
exclude: ".noExl",
name: "Worksheet Name",
filename: "SomeFile", //do not include extension
fileext: ".xls" // file extension
});
});
Add the CSS class ‘noExl’ to any tr
tags to ignore the specified table data while exporting.
<tr class="noExl">
<th>#</th>
<th>Column heading</th>
<th>Column heading</th>
<th>Column heading</th>
</tr>
Add the background and font colors. Default: false.
$("#table2excel").table2excel({
exclude: ".noExl",
name: "Worksheet Name",
filename: "SomeFile",
fileext: ".xls",
preserveColors: true
});
Done
Thanks for make jQuery plugin is developed by For more Helpfull for users, please check the demo page or visit the official website.