print just text area and force page breaks

liunx

Guest
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 appreciatedThis 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 :p

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 replythe 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.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.Take a look here it may start you in the right direction.


<!-- w --><a class="postlink" href="http://www.huntingground.freeserve.co.uk/style/tutorials/printing.htm">www.huntingground.freeserve.co.uk/style ... inting.htm</a><!-- w -->

until someone comes with a more solid exampleThank 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.
 
Back
Top