@media print and @page, Need a sample |
@media print and @page, Need a sample |
Ian Hicks |
Oct 18 2020, 06:33 PM
Post
#1
|
Group: Members Posts: 3 Joined: 23-August 20 From: Australia Member No.: 27,511 |
Hi, folks.
I am generating a browser-based report for the data in a spreadsheet. The user (usually) wants to preview the report in the IE browser, but often needs to have it print directly to the printer, or to use Ctrl-P to print from the preview. I am having some issue getting the 'report' to properly format for printing, primarily when I want to generate a Landscape A4 report. Are there any simple examples around that I can base myself on, so that the report I generate (containing mostly a table) will by default print with page size A4 in Landscape? I have been able to get the <thead> and <tbody> stuff working well so it repeats the heading, and doesn't leave widows or orphans. But it's the default pagination that I cannot figure. Thanking you all in advance Ian |
CharlesEF |
Oct 19 2020, 01:16 PM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Check the accepted answer here. Does that help?
|
Ian Hicks |
Oct 19 2020, 04:18 PM
Post
#3
|
Group: Members Posts: 3 Joined: 23-August 20 From: Australia Member No.: 27,511 |
Not really. That talks about CSS2.1, and is from 12 years ago. This stuff 'should' be pretty simple (at the user's end, I get that the browser developers would have a hard time as paper pages are a different concept to continuous html pages). |
Darin McGrew |
Oct 19 2020, 06:06 PM
Post
#4
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
That talks about CSS2.1, and is from 12 years ago. So? CSS3 has a "Paged Media Module", but it's still a working draft, not a recommendation.But if you want to see it, here it is: https://www.w3.org/TR/css-page-3/ |
Lo-Fi Version | Time is now: 27th April 2024 - 09:11 PM |