formatting the page so it prints nicely

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
gasoga
Forum Commoner
Posts: 36
Joined: Thu Apr 17, 2003 4:15 am
Location: Ireland

formatting the page so it prints nicely

Post by gasoga »

Hi i was wondering if anyone knows how to format my php/html page so that it prints on a4 paper without cuttin off half the information , at the moment i am missin half a table because it is too wide??!!

Does anyone know any tutorials or any ideas how to make it print on one page?!

Thanx
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

the only way your gonna do it is by making your table narrower....isn't it?

or you could have an option for a printer friendly page
gasoga
Forum Commoner
Posts: 36
Joined: Thu Apr 17, 2003 4:15 am
Location: Ireland

Post by gasoga »

yeah but when i do that all the information gets squished!!

Do you know how i would make a printer freidnly version?
liviu
Forum Newbie
Posts: 16
Joined: Fri Jul 18, 2003 6:39 pm
Location: Tulcea, Romania

Post by liviu »

It depends on what your output is on that page. My sugestion is to skip the tables and put your information directly on page, using <br> between rows (much like Microsoft :twisted: Word...). That page is generated by a script ?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

A tip of usage is the http://se.php.net/manual/en/function.wordwrap.php function. It just might come in handy to you.

Edited:
Thought I could add this too: NoWrap
Using this you have yet another option to use for formating a table.
Last edited by JAM on Fri Aug 29, 2003 8:12 pm, edited 1 time in total.
liviu
Forum Newbie
Posts: 16
Joined: Fri Jul 18, 2003 6:39 pm
Location: Tulcea, Romania

Post by liviu »

Yes, this is another solution, and so you kan use tables for better formatting...
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

I guess it depends on what you're doing. If you're creating large tabular data, this will be of no use to you, but for general use you can define a stylesheet for print vs. screen media, which can have display of certain items turned off, moved around, etc.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

You need two stylesheets: one for printing (we'll call it print.css) and one for browser display (say browser.css):

Code: Select all

<link rel="stylesheet" href="print.css" media="print">
<link rel="stylesheet" href="browser.css" media="screen">
The order of the two lines is important: if the browser does not understand media types it uses both stylesheets. Thus, browser.css styles should override any styles defined in print.css.

Doesn't work in Netscape 4 - would need to link to a second, printer friendly page.
Post Reply