This is a discussion on printing a page within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I haven't figured where to post this. I'm working in PHP so I thought I would try here. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I haven't figured where to post this. I'm working in PHP so I thought I
would try here. I have four pieces of information I want to display -- each is variable number of lines. For viewing, I want it to be a long, narrow display so that you only need to scroll down to see everything. So it will be a table with 4 rows. When printing though, I want it to be shorter so that everything will usually fit on one page. For that, I need rows 2 and 3 to be side by side. The equavalent of what I want is viewing <table><tr><td>stuff1</td></tr><tr><td>stuff2</td></tr><tr><td>stuff3</td></ tr><tr><td>stuff4</td></tr></table> printing <table><tr><td>stuff1</td></tr><tr><td>stuff2></td><td>stuff3</td></tr><tr>< td>stuff4</td></tr></table> I've used media type on CSS to make printed output look different from displayed output but for the life of me, I cannot figure out how I can get php to render this page so that it will print side by side when printing. Anyone have any ideas? Thanks, Greg |
|
|||
|
"Greg Brewer" <Greg@Brewer.net> schreef in bericht news:40c3ab6e$0$444$a726171b@news.hal-pc.org... > I haven't figured where to post this. I'm working in PHP so I thought I > would > try here. > > I have four pieces of information I want to display -- each is variable > number of lines. For viewing, I want it to be a long, narrow display so > that you only need to scroll down to see everything. So it will be a table > with 4 rows. > > When printing though, I want it to be shorter so that everything will > usually fit on one page. For that, I need rows 2 and 3 to be side by side. > > The equavalent of what I want is > viewing > <table><tr><td>stuff1</td></tr><tr><td>stuff2</td></tr><tr><td>stuff3</td></ > tr><tr><td>stuff4</td></tr></table> > > printing > <table><tr><td>stuff1</td></tr><tr><td>stuff2></td><td>stuff3</td></tr><tr>< > td>stuff4</td></tr></table> > > > I've used media type on CSS to make printed output look different from > displayed output but for the life of me, I cannot figure out how I can get > php to render this page so that it will print side by side when printing. > > Anyone have any ideas? > > Thanks, > Greg > > > Greg, When the user presses the print button ( or when the javascript function window.print() is called) the page gets printed. All of this is on the client machine and the current (the 'viewing') HTML will be printed. My guess is to make an extra step and create a second page with the 'printing' HTML. Add a 'print' button on the viewing HTML and when clicked show the printing page and let the user print the page through the browser. or add a hidden iframe and set the src attribute to the printing page. When the user hits your printing button on the viewing HTML call document.iframe_id.print(); in javascript and the printing page will be printed. As you see the actual printing is done in javascript so for further help on this subject you should go to a javascript newsgroup. HTH rob |