2017-02-20 1 views
2

html 테이블 데이터를 xlsx로 내 보내야합니다. github에서 calrketm/TableExport를 사용하고 있지만 ... Xlsx 버튼으로 내보내기를 볼 수 없습니다. 어떻게해야합니까? 여기에 the output나는 xlsx 버튼이 보이지 않는 이유는 calrketm/TableExport를 사용하고 있습니까?

+0

만약 당신이 어떤 API 또는 사용 특정 질문이있는 경우, [github에]를 통해 직접 나에게 연락 주시기 바랍니다 (https://github.com/clarketm/TableExport) 또는 [TABLEEXPORT에서 들여다 봐도 docs] (https://www.travismclarke.com/tableexport/). –

답변

3

이것은 기본적으로 "xlsx"가 포함되어 있지 않기 때문입니다. 아래 기본값을 참조하십시오.

$("table").tableExport({ 
    headings: true,      // (Boolean), display table headings (th/td elements) in the <thead> 
    footers: true,      // (Boolean), display table footers (th/td elements) in the <tfoot> 
    formats: ["xls", "csv", "txt"],  // (String[]), filetype(s) for the export 
    fileName: "id",      // (id, String), filename for the downloaded file 
    bootstrap: true,     // (Boolean), style buttons using bootstrap 
    position: "bottom",     // (top, bottom), position of the caption element relative to table 
    ignoreRows: null,     // (Number, Number[]), row indices to exclude from the exported file 
    ignoreCols: null,     // (Number, Number[]), column indices to exclude from the exported file 
    ignoreCSS: ".tableexport-ignore", // (selector, selector[]), selector(s) to exclude cells from the exported file 
    emptyCSS: ".tableexport-empty",  // (selector, selector[]), selector(s) to replace cells with an empty string in the exported file 
    trimWhitespace: false    // (Boolean), remove all leading/trailing newlines, spaces (including non-breaking spaces), and tabs from cell text 
}); 

"xlsx"를 포함하려면 다음 구성을 제공해야합니다.

$("table").tableExport({ 
    formats: ["xls", "csv", "txt", "xlsx"] 
}); 
+0

또한 SheetJS에서 xlsx.core.js를 포함해야합니다. 이제 작동합니다. 감사. – dany

관련 문제