4
我有以下功能,它很棒。拉伸格到A4尺寸
<script type="text/javascript">
function printDiv(printpage)
{
var headstr = "<html><head><title></title></head><body>";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
</script>
但是,我的div大约是纸张大小的一半。当函数被调用时,是否有办法让我的div伸展到全纸尺寸?
你可以尝试设置'高度:100%' – Grundy
复制的[在打印功能弹力的div](http://stackoverflow.com/questions/20444860/stretch-div-upon-print-function) –
possib le复制[是否可以使用其整个宽度在A4上打印div的内容?](http://stackoverflow.com/questions/7664093/is-it-possible-to-print-the-contents-使用其全宽度) – cubrr