横向打印HTML表格 [英] Print html table in landscape

查看:275
本文介绍了横向打印HTML表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从数据库动态生成的报告,该报告的某些部分应打印在表中.我想在横向轮廓中打印此表,其余的报告通常应打印为人像".

I have a report dynamically generated from the database, a certain part of this report should be printed inside a table. I would like to print this table in landscape outline put the rest of the report should be printed normally "portrait".

那么,有什么想法可以实现这一目标吗?

So, any ideas how to accomplish that?

推荐答案

如果创建表格并将其视为相对于页面的100%宽度,则打印机应自动打印到整个页面宽度.是横向还是纵向取决于实际打印时在打印设置中选择的哪一个.唯一能够完全完成此操作的方法是制作两个单独的html文档-一个包含纵向部分,另一个包含横向部分.然后分别打印每个文档.

If you create a table and treat it as 100% width relative to the page, then the printer should automatically print to the full page width. Whether you get landscape or portrait depends on which one you choose in the print settings when you actually print it. The only way you'll be able to accomplish this cleanly is to make two seperate html documents -- one that contains the portrait portions and the other that contains the landscape portions. Then print each document separately.

完成任务只有另外两种理论方法: 1)一种浏览器插件,可以为您发送单独的打印作业,从而确定应以哪种方式打印文档的哪些部分.

There are only two other theoretical ways of accomplishing the task: 1) Some kind of browser plugin that would send separate print jobs for you, figuring out which portions of the document should be printed in which fashion.

2)使用CSS3转换.生成要打印的表格的静态图像,然后在页面上将其转换(旋转)90度,使其在屏幕上横向显示.如果您旋转了文档的某些部分,那么从理论上讲,您可以在一项工作中完成整个工作.但是,甚至不要浪费您的时间.这将是一场噩梦.特别是如果您不得不问该怎么做.

2) Using CSS3 Transforms. Generate a static image of the table to print and then transform (rotate) it 90 degrees on the page so it looks sideways on the screen. If you rotated some parts of the document, then theoretically you could accomplish the whole thing in one job. But don't even waste your time. This would be an utter nightmare. Especially if you had to ask how to do it.

这篇关于横向打印HTML表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆