Results 1 to 6 of 6

Thread: Printing a section of a page

  1. #1
    Join Date
    Jul 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Printing a section of a page

    If you look on my website, www.cubpack88.org, you will see a calendar towards the bottom of the page. If I want to use a script to just print out that table without using an alternate document. I'm using a print redirect with <link rel=alternate media=print href="http://www.cubpack88.org/print_redirects/upcoming_events.doc"> WHen I try to print the page always comes out blank. ANy suggests on what I can do to fix this. I've tried it with the file outside of a folder but it wont work that way either.

    This one has me really stumped.

    Regards,

    Matthew
    Last edited by Scrounger; 01-13-2008 at 10:37 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    You can also easily control what parts of your page print out by adding a special stylesheet that will be used for printing to the <head> section of your page like this

    Code:
    <link rel="stylesheet" href="print.css" type="text/css" media="print" />
    The print.css file should contain the following:
    Code:
    body {visibility:hidden;}
    .print {visibility:visible;}
    Now all you need to do is to assign class="print" to whatever parts of your web page that you want to have print out. Anything on the page not assigned to this class will not print.

  3. #3
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  4. #4
    Join Date
    Jul 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I like how this will work but inside FrontPage I'm stuck on how you assign a class to a table without doing it in the code. I want to use the FrontPage interface to do it. Can I do it that way or do I have to do it in the code.

    Regards,

    Matthew

  5. #5
    Join Date
    Jul 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Master_script_maker View Post
    I've tried this one for a few days and I can't get the button or the text to appear to get the page to print.

    I can't figure out what I'm missing, this shouldn't be this hard.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You need to be precise with stylesheets. If you have one for the screen and one for the printer, each should be labeled as such so its styles cannot 'spill over' to the other:

    Code:
    <link rel="stylesheet" href="screen.css" type="text/css" media="screen">
    <link rel="stylesheet" href="print.css" type="text/css" media="print">
    Also the suggestion given here:

    Code:
    body {visibility:hidden;}
    .print {visibility:visible;}
    will never work because visibility is inherited - unless you have content outside the body, which is wrong to do anyway. If the entire body is hidden, nothing in it can be seen.

    When adding class names to elements, it is often easier to use a text only editor like notepad.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •