我在html表格上创建打印选项。 该表格有数百行。数据从php和AJAX中获取。 获取这些数据后,我将创建一个如下所示的打印选项。如何在每个页面中使用默认标题打印html表格
function PrintElem(elem){
Popup($(elem).html());
}//
function Popup(data)
{
var mywindow = window.open('', 'my div', 'width=100%');
mywindow.document.write('<html><head><title></title>');
mywindow.document.write('<link rel="stylesheet" href="<?php echo base_url(); ?>/resources/css/bootstrap.css" />');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.document.close(); mywindow.focus(); //newwindow.focus();
mywindow.print(); mywindow.close();
return true;
}//
<span class="trial_balance_ajax" id="print_section">
<!---- Ajax table data loads here----->
</span>
现在我试图在打印文档的每个页面中打印表格标题列。 但在这种情况下,数据头只显示第一页,然后在其他页面数据溢出...
我想在每个页面默认的列标题
请帮助
你真的不应该使用'document.write' – meskobalazs 2015-02-09 13:25:10