Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to print exactly as displayed?

Status
Not open for further replies.

Luongo1

Programmer
Oct 13, 2006
52
CA
Hi,

I created a form in HTML that I'd like visitors to be able to print out and fill in. The problem is, the tables do not print as displayed on the screen (ie the cellspacing, etc). What's the best way to have the page printed exactly as it is displayed on the screen?

Thanks...
 
It's never going to be "exact"... But there are several ways of getting a good approximation:

- Don't specify widths in pixels, as paper isn't measured on pixels... use percentages instead. This way, "100%" of the screen (or whatever percentage you choose), will be "100%" of the paper width.

- You could instead choose to use a print style sheet, which re-defines the element widths in percentages or points, etc (or some other print-based unit).

My money is on the former suggestion if you are using tables, possibly with some extra print CSS to remove things like navigation, etc, if needed.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Push printscreen? It is hard to advise on such a matter. You should avoid background colours because they won't get printed by default. Do not make fixed pixel sized containers as pixel means nothing on paper. If you opt for percentages, you will be better off. Other than that, the page should print just like it looks (except for any printing stylesheets that might be in place).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top