gpt4 book ai didi

javascript - 将水平滚动的内容打印到下一页 - 可能吗?

转载 作者:行者123 更新时间:2023-11-29 10:18:42 24 4
gpt4 key购买 nike

我一直在尝试打印水平滚动的内容,但没有成功。我已经厌倦了搜索,我想是时候问一问了 -

所以这里开始,下面是我要打印的内容的真正简化版本 -

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

Print Stylesheets for pages with long horizontal tables -(这个链接还有一些其他选项,是唯一的方法吗?)

最佳答案

简短而甜蜜:不...

您完全无法控制使用 javascript 打印内容的方式。您能做的最好的事情就是将“Something long to print#6+ 包装到下一行”。

关于javascript - 将水平滚动的内容打印到下一页 - 可能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15798401/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com