Page 1 of 1
formatting the page so it prints nicely
Posted: Fri Aug 29, 2003 6:31 am
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
Posted: Fri Aug 29, 2003 6:35 am
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
Posted: Fri Aug 29, 2003 6:47 am
by gasoga
yeah but when i do that all the information gets squished!!
Do you know how i would make a printer freidnly version?
Posted: Fri Aug 29, 2003 7:54 pm
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

Word...). That page is generated by a script ?
Posted: Fri Aug 29, 2003 8:00 pm
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.
Posted: Fri Aug 29, 2003 8:09 pm
by liviu
Yes, this is another solution, and so you kan use tables for better formatting...
Posted: Fri Aug 29, 2003 9:12 pm
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.
Posted: Sat Aug 30, 2003 2:45 pm
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.