/    Sign up×
Community /Pin to ProfileBookmark

Print Stylesheet Control

Trying to offer a media=print stylesheet to print a page with a big, 100% width table on it but can’t seem to control the margins on the printed page. Is that doable?

I want to reduce the printed page margins to let the table have all the space it can and so not wrap some of the content but nothing I am doing is influencing them.

to post a comment
CSS

10 Comments(s)

Copy linkTweet thisAlerts:
@toicontienMar 17.2004 — The following CSS should control that:
[code=php]
@page { margin: #<unit>; }
[/code]
Copy linkTweet thisAlerts:
@SainkhoauthorMar 17.2004 — Tried that;
[code=php]<style>@page {margin: 1cm}</style>[/code]

Didn't do diddly
Copy linkTweet thisAlerts:
@SamMar 17.2004 — are you sure your printer will even support 1cm margings? thats really small
Copy linkTweet thisAlerts:
@SainkhoauthorMar 17.2004 — [sheepish]

Ahem, well, er no, actually. I just kinda assumed that the printers/browsers of this world would bow to the power of css.

Maybe in a parallel universe....
Copy linkTweet thisAlerts:
@SamMar 17.2004 — I don't know if that's the problem in this case, but my personal printer can't go below a 1/4in
Copy linkTweet thisAlerts:
@DaveSWMar 17.2004 — The @page feature may not be supported by your browser. Which browser are you using?
Copy linkTweet thisAlerts:
@SainkhoauthorMar 18.2004 — It's intended for an intranet and I'm reliably informed that the base spec is IE 5.

If it can't be done, well, it can't be done and there's no harm done.
Copy linkTweet thisAlerts:
@pyroMar 18.2004 — IE5!?! Ouch.
Copy linkTweet thisAlerts:
@fredmvMar 18.2004 — [i]Originally posted by pyro [/i]

[B]IE5!?! Ouch. [/B][/QUOTE]
I don't think you even needed to put the "5" there&hellip; ?
Copy linkTweet thisAlerts:
@BonnerMar 18.2004 — Should we be saying @page or @print?

You should also use pt sizing when printing.
×

Success!

Help @Sainkho spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...