📜  自定义函数(doc)数据表可打印 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:47.134000             🧑  作者: Mango

代码示例1
Plain text12345678910111213141516{ extend: 'print',text: '',                        title: '@lang('invoices.products')',                        messageTop: '{{ Auth::user()->office_name }}',                        className: 'btn btn-default',                        autoPrint: true,                         customize: function (win) {                            $(win.document.body).find('th').addClass('display').css('text-align', 'center');                            $(win.document.body).find('table').addClass('display').css('font-size', '16px');                            $(win.document.body).find('table').addClass('display').css('text-align', 'center');                            $(win.document.body).find('tr:nth-child(odd) td').each(function (index) {                                $(this).css('background-color', '#D0D0D0');                            });                            $(win.document.body).find('h1').css('text-align', 'center');                         }}