faqts : Computers : Programming : Languages : PHP : Not Quite PHP : HTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 34 people (38%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How can I build a printer friendly page?

Aug 23rd, 2000 18:56
Philip Olson, Nathan Wallace, se@lakenet.no


Output the same data as the regular page, but without all the fancy
menus, header/footer and fancy stuff, etc.  It's common to have all the 
information on one long page too as that'll print nicely.
Make the page a printable width of 100%.  Try not to use many colors 
here either.  Here's one way to add these customizations :
  <? 
    if ($mode == "print") { 
      echo "this value I"; // table width, font size, whatever
    } else { 
      echo "this value II"; // non-print mode value
    }
  ?>
The url would look like this (if printable version) :
   http://www.yoururl.com/blah/?mode=print
You can add simular statements throughout your code.  Also, this can be 
done in your CSS as that is a very good place to have different modes 
and looks to your site.