HTML Table to CSV

This is small JQuery utility which allows you to export any HTML table as CSV file. Its very handy tool to use specially during development of reporting projects. It is also useful when you have some 3rd party JQuery table search plugin attached to your table.

Example

Title Name Phone
Mr. John 07868785831
Miss Linda 0141-2244-5566
Master Jack 0142-1212-1234
Mr. Bush 911-911-911

Option 1  Option 2  Option 3  Option 4  Download   Comments About Me

<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js" > </script>
<script type="text/javascript" src="http://www.kunalbabre.com/projects/table2CSV.js" > </script>

Download Plugin    

Option 1

$('#example1').table2CSV();



Option 2

This can be used when you need custom header
$('#example1').table2CSV({
	header:['prefix','Employee Name','Contact']
});



Option 3

This can be used when you need to get output as string
alert(
$('#example1').table2CSV({
delivery:'value',
header:['prefix','Employee Name','Contact']
}));



Option 4

This can be used when you need different separator
alert(
$('#example1').table2CSV({
separator : ';',
delivery:'value',
header:['prefix','Employee Name','Contact']
}));