0

我想打印包含很多列的表。

我这样做的方式如下

function PrintPlanning() 
{
    var data = $('#planning').html();
    var mywindow = window.open();
    mywindow.document.write('<html><head><title>Planning</title>');
    mywindow.document.write('<link type="text/css" rel="stylesheet" href="/print.css"/>');
    mywindow.document.write('</head><body>');
    mywindow.document.write('<div id="planning">');
    mywindow.document.write(data);
    mywindow.document.write('</div>');
    mywindow.document.write('</body></html>');

    mywindow.print();

    return true;
}

我的桌子是这样的,而且很大。

<div id="planning">
    <table>
        ...
    </table>
</div>

当我启动该功能时,会出现打印概览,但我的表格适合宽度页面并且内容变得非常小(不可读)。

是否可以在新页面上水平扩展它?也许与CSS?

4

0 回答 0