【发布时间】:2016-07-20 06:29:44
【问题描述】:
我正在使用 table2excel 将由 jQuery DataTables 提供支持的数据表导出到 Excel。我可以将数据导出到 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>
【问题讨论】:
-
最好使用 Jasper 报告。
标签: javascript jquery html excel datatables