0
我使用table2excel將由jQuery DataTables支持的數據表導出到Excel。我能夠將數據導出爲Excel,但我無法將表導出到標題。如何使用table2excel將包含表頭的表格導出到Excel
這裏是我的代碼
$('#btn-export').on('click', function() {
$('<table>').append(table.$('tr').clone()).table2excel({
exclude: "",
name: "EmailTracking",
filename: "EmailTracking" //do not include extension
});
});
這裏是我的HTML:
<table id="userGrid" class="table table-striped table-bordered dt-responsive nowrap " cellspacing="0" width="100%">
<thead>
<tr>
<th>User</th>
<th>Subject</th>
<th>Sent On</th>
<th>To</th>
<th>Cc</th>
<th>Bcc</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
更好地使用賈斯珀報告。 – Ranjan
https://datatables.net/forums/discussion/28188/how-to-set-name-of-column-visible-when-export-excel-plugin-tabletool – Ranjan