The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> @media print and @page, Need a sample
Ian Hicks
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post 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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ian Hicks
post Oct 19 2020, 04:18 PM
Post #3





Group: Members
Posts: 3
Joined: 23-August 20
From: Australia
Member No.: 27,511



QUOTE(CharlesEF @ Oct 19 2020, 01:16 PM) *

Check the accepted answer here. Does that help?

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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post 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



QUOTE(Ian Hicks @ Oct 19 2020, 01:18 PM) *
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/
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 02:31 AM