Forum Moderators: coopster

Message Too Old, No Replies

web printing a report

how can i set margins?

         

maxxtraxx

1:20 am on Jun 8, 2003 (gmt 0)

10+ Year Member



don't know if this is the right forum for this question but i have a report that i am generating dynamically using PHP and it works great.

however, when i go to print it out from my browser(IE5.5), the table that is generated is sometimes a little too large for the page and subsequently gets cut off. is there a way to setup the margins for when the page prints?

btw, i already have set the page margins to 0, but that does not help when printing. e.g.- <body leftmargin="0" topmargin="0">

any advice would be much appreciated!

jamesa

1:38 am on Jun 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For printing you don't want the page to exceed 585 pixels in width. If the page conforms to the window size (as in tables that use percentage widths) then you should be fine too because the content would wrap.

You could also use a media=print stylesheet so you can create a different layout for print, but check browser compatability -- I'm not sure how many support that right now.

dingman

3:12 am on Jun 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IIRC, I found an '@media print {}' section to work in all Geck-based browsers, Opera 6 and above, and IE6. I don't have IE below six to test on, nor any Mac browsers.

There was a thread about it in the CSS forum a while back.

I don't, haven't, and won't design pages in fixed units, so I know nothing about pixel width choices. However, I *assume* that they vary depending on printer resolution, and I'm *sure* they vary depending on what size paper is standard where the person is printing.