Results 1 to 3 of 3

Thread: Print only contents of <DIV>

  1. #1
    Join Date
    Feb 2005
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Print only contents of <DIV>

    Howdy folks,

    Through the use of an onclick event such as:

    Code:
    <a onclick="window.print()">Print Me</a>
    ...is there a way to setup the print call to only print contents of a specified div tag? I messed around with a few iterations to no avail.

    In other words, how could I go about printing only the contents of <DIV ID="Div1">?

    Thanks - and let me know if you have any questions...

    - I

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Not as such, no. You can use a print style sheet to control what is and what isn't printed, and you could use scripting to change how it applies to the document, if necessary (with the usual caveat that users will get very different behaviour if scripting is disabled or lacking the necessary features).

    Mike

  3. #3
    Join Date
    Feb 2005
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, Mike

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
  •