Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

export table data to excel in jquery

$( document ).ready(function() {
	$(".export").click(function() {
		var export_type = $(this).data('export-type');		
		$('#data_table').tableExport({
			type : export_type,			
			escape : 'false',
			ignoreColumn: []
		});		
	});
});
Comment

export table data to excel using javascript or jquery

function exportTableToExcel(tableID, filename = ''){
    var downloadLink;
    var dataType = 'application/vnd.ms-excel';
    var tableSelect = document.getElementById(tableID);
    var tableHTML = tableSelect.outerHTML.replace(/ /g, '%20');
    
    // Specify file name
    filename = filename?filename+'.xls':'excel_data.xls';
    
    // Create download link element
    downloadLink = document.createElement("a");
    
    document.body.appendChild(downloadLink);
    
    if(navigator.msSaveOrOpenBlob){
        var blob = new Blob(['ufeff', tableHTML], {
            type: dataType
        });
        navigator.msSaveOrOpenBlob( blob, filename);
    }else{
        // Create a link to the file
        downloadLink.href = 'data:' + dataType + ', ' + tableHTML;
    
        // Setting the file name
        downloadLink.download = filename;
        
        //triggering the function
        downloadLink.click();
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: variable for every user discord.js 
Javascript :: javascript get all days of week 
Javascript :: jshint ignore 
Javascript :: namespace in javascript 
Javascript :: create fooer on print page with jquery 
Javascript :: repeat an array multiple times in js 
Javascript :: for each loop with arrowfunction 
Javascript :: base64 to image nodejs 
Javascript :: reactjs node sass incompatible with ^4.0.0 ^5.0.0 
Javascript :: jquery hide select option 
Javascript :: extends in javascript 
Javascript :: generate apk debug react native 
Javascript :: regex youtube id 
Javascript :: mongodb mongoose aggregate two collections using lookup & format the result set. 
Javascript :: javascript select multiple values 
Javascript :: json stringify 
Javascript :: countdown timer with moment js 
Javascript :: radio button getelementsbyname 
Javascript :: node get package.json version 
Javascript :: json minecraft 
Javascript :: frequency of characters in a string in javascript 
Javascript :: find my url in nodejs 
Javascript :: js create p element with text 
Javascript :: handlechange in react 
Javascript :: javascript number format indian currency 
Javascript :: cambiar background image javascript 
Javascript :: load external javascript file angular component 
Javascript :: react conditional class 
Javascript :: convert utc to pst javascript 
Javascript :: create and fill array javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =