www.webdeveloper.com
Results 1 to 6 of 6

Thread: print just text area and force page breaks

  1. #1
    Join Date
    May 2005
    Posts
    33

    print just text area and force page breaks

    I was reffered here from the javascript forum. I actually don't know any css. i was told thought that css is the best way to print anything other than what the browser displays.

    that being said, i have a javascript program which creates an ammortization table into a text area. My origional problem was that i wanted to print only the text area. It was then that i was told that css would be the best way to go. Also, the ammortization is usually larger than the text area, which means the text area scrolls. Origionally i solved this by making the text area larger, which meant that users could not print an ammortization larger than 720 months, though there is no plausible reason why they would want to. My second problem emerged when i tried to print the page to test out the program. The printer tries to fit the entire text area on one page, meaning that everything after mont 66 and about half of 67 is cut off and not printed.

    later i was given this code
    <style type="text/css"
    textarea{overflow:visible}
    </style>

    when i put it into a test file, it allowed me to print some overflow (about 2 or three lines out of 7 or 8), partially eliminating the need for the larger text area, but not eliminating the cut off, or my wish to print only the text area.

    any help would be greatly appreciated

  2. #2
    Join Date
    Jan 2004
    Location
    Sweden
    Posts
    850
    This sounds like a media="screen" and media="print" solution to me...

    or you can just link to a simple .txt file where it can be easily printed

    I am not qualified to help you though other than point you to the right direction.
    You could always try searching for media print or wait till someone to reply

  3. #3
    Join Date
    May 2005
    Posts
    33
    the problem with a .txt file is that the javascript writes the information inside the text area based on the information the user gives the program. i'm not sure how i would go about setting up a .txt file for something like that.

    but thank you for the help, i will look for information on media print, but i'll also wait and see if someone else replies, since i don't know anything really about css and probably won't know what to do with the information if i do find it.

  4. #4
    Join Date
    May 2005
    Posts
    33
    i found some things on meda print, and on page breaks, but most of it was just confusing. In short, nothing i found could really answer my questions.

  5. #5
    Join Date
    Apr 2003
    Location
    UK
    Posts
    2,203
    Take a look here it may start you in the right direction.


    http://www.huntingground.freeserve.c...s/printing.htm

    until someone comes with a more solid example
    Last edited by Mr J; 05-27-2005 at 02:13 PM.
    The Silent One

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is one with an idea

  6. #6
    Join Date
    May 2005
    Posts
    33
    Thank you for the link, it was a bit clearer.

    Here is an update:
    My main problem at this point is with the page break commands, here is the css I had before with some I halfway figured out

    <HEAD><style type="text/css" media="print">
    textarea{overflow:visible}
    textarea{page-break-inside:auto}
    Page{size:portrait}

    </style>

    At this point, the printer still cuts the textarea off at month 66 which is row 70 I believe. Interesting enough, it now prints another blank page. As I said before I don't know anything about css, so I'm not entirely sure I'm even applying it properly.

    also: i tried replacing auto with inherit, but it didn't change anything.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles