我一直没有成功尝试打印水平滚动内容。我已经到了厌倦搜索的地步,我想是时候问了——
所以这里是,下面是我要打印的内容的一个非常简化的版本 -
的HTML
<div id="printingDiv">
<div class='filterRow'>Something long to print#1 Something long to print#2 Something long to print#3 Something long to print#4 Something long to print#5 Something long to print#6 Something long to print#7 Something long to print#8 Something long to print#9 Something long to print#10</div><br/>
<div class='filterRow'>Something long to print#1 Something long to print#2 Something long to print#3 Something long to print#4 Something long to print#5 Something long to print#6 Something long to print#7 Something long to print#8 Something long to print#9 Something long to print#10</div><br/>
<div class='filterRow'>Something long to print#1 Something long to print#2 Something long to print#3 Something long to print#4 Something long to print#5 Something long to print#6 Something long to print#7 Something long to print#8 Something long to print#9 Something long to print#10</div><br/>
<div class='filterRow'>Something long to print#1 Something long to print#2 Something long to print#3 Something long to print#4 Something long to print#5 Something long to print#6 Something long to print#7 Something long to print#8 Something long to print#9 Something long to print#10</div><br/>
</div>
CSS
.printDiv {
font-size: 12pt; //else the content adjusts its font-size just to fit the print page
width: auto;
}
.filterRow {
white-space: no-wrap; //just for the sake of this example, to make sure the content overflows
width: auto;
}
Javascript
$("#printingDiv").show();
window.print();
输出
在打印输出上 - 我只看到内容,直到Something long to print#5和Something long to print#6的一部分。
我想看到的是Something long to print#6 到Something long to print#10 的其余部分打印在下一页上。
因此,总而言之,我希望能够将不适合第一页的水平滚动内容打印到另一页上。这甚至可能吗?
我提到的一些链接 -
http://alistapart.com/article/goingtoprint
http://meyerweb.com/eric/articles/webrev/200001.html
为具有长水平表格的页面打印样式表- (此链接有一些其他选项,这是唯一的方法吗?)