function base64(content) {
        return window.btoa(unescape(encodeURIComponent(content)));
    }
    function tableToExcel(tableID, fileName) {
        var excelContent = $("#" + tableID).html();
        //      alert(excelContent);
        var excelFile = "";
        excelFile += "";
        excelFile += "";
        excelFile += excelContent;
        excelFile += "
"; excelFile += ""; var link = "data:application/vnd.ms-excel;base64," + base64(excelFile); var a = document.createElement("a"); a.download = fileName + ".xlsx"; a.href = link; a.click(); }