如何使一个网页的可打印版本?
我想为我的网页制作可打印版本。我已经尝试使用CSS为页面做一个单独的样式表,但它不能正常工作(即它不会摆脱顶部的边距,菜单栏背景也不会消失。)该页面包括数百表,当我做一个打印预览,他们也有时在页面之间分裂。
I would like to make a printable version of my web page. I have already tried using CSS to make a separate stylesheet for the page but it is not working properly.(i.e. it will not get rid of margin at the top also the menu bar background will not go away.) the page consists of hundreds of tables and when i do a print preview they also get split between pages sometimes.
这些表是根据用户在复选框中的选择动态生成的,是否可以添加可打印链接,该链接将从当前页面获取内容并将其放入页面中
these tables are generated dynamically according to users choices in checkboxes is it possible to add a printable link which will take the content from the current page and put it into a page where it can be mad more printer friendly?
不需要两个不同的页面。您应该创建一个不同的CSS表单。在你复制现有的,只需设置所有的黑/白(或几种颜色,如果你真的需要它们),删除任何菜单和元素,你不需要放置 display:none;
在他们的CSS声明,并摆脱不必要的边距。你应该在这里和那里放一个 margin:0
或 margin-top:0
如果你不显示你的HTML和CSS代码很难更具体。
There is no need of two different pages. You should create a different CSS sheet. After you copy the existing one, just set everything in black/white (or a few colours if you really need them), remove any menus and elements you don't need by putting display: none;
in their CSS declaration, and to get rid of the unwanted margins. You should just put a margin: 0
or margin-top: 0
declaration here and there. If you don't show your HTML and CSS code is difficult to be more specific.