Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2004, 07:14 PM
Authorized User
 
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to format web page to a printable page?

Hi,
  I am creating a web report which displays in a table layout. I like to be able to print page heading/footing on every report page. Could anyone help or show me?

Thanks in advance,

Peter
__________________
Peter
 
Old May 2nd, 2004, 05:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use a CSS file with media="print" (to signify that the styles in that file only relate to printers. You can turn things on and off, by putting display: none in your CSS file.

For instance, you could have a header-style which is explicitly given a display: none in your regular CCS file, and wrap your header text in a <span> or <div> tag with that style applied to it. Also, of course, you could put something in your printer's stylesheet that says input {display: none; }, to prevent things like textareas and buttons being included in the printed page.

Also, remeber to use relative (and not absolute) width for things - i.e. <table width="95%"...> instead of <table width="970"...>, since that will allow them to shrink or grow to fill the width that's being given to them. This is a general piece of advice, in fact, since otherwise Jakob Nielsen will call you all sort of names for making him scroll sideways (although there are some who wish he would bloody scroll off sideways, of course!)

Have a read of what the great Eric Meyer says here:
http://www.meyerweb.com/eric/article...ev/200001.html
 
Old May 3rd, 2004, 01:34 PM
Authorized User
 
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the quick respond. I'll test out your suggestion. I'm sure it'll works.

Thanks,
Peter

Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to prevent a web page/window page from copying pradeeppatnaik81 C# 2 April 9th, 2008 03:36 AM
How to diplay web page inside another web page win cyberjoe C# 2 March 1st, 2007 05:35 AM
Crystal Reports Format - Page Breaks ricta Crystal Reports 2 December 31st, 2005 05:30 AM
how to format a diplayed page for print lanita PHP How-To 0 November 6th, 2004 10:40 PM
Printable reports from an ASP web application James Diamond Classic ASP Basics 2 February 23rd, 2004 03:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.