大家好,我有一个问题,这可能是新手问题
我的网站中有一个数据表,现在我想将其打印或导出到 Excel 文件中,但我遇到的问题是标签 <tfoot></tfoot>
未包含在打印和导出中
这是我的代码:
JS:
<script type="text/javascript" class="init">
$(document).ready(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
{
extend: 'print',
customize: function ( win ) {
$(win.document.body)
.css( 'font-size', '10pt' )
.prepend(
'<img src="http://datatables.net/media/images/logo-fade.png" style="position:absolute; top:0; left:0;" />'
);
$(win.document.body).find( 'table' )
.addClass( 'compact' )
.css( 'font-size', 'inherit' );
}
}
]
} );
} );
</script>
最佳答案
关于javascript - JS : datatables printing and exporting excel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53236969/