Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate page break position

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

Assuming there's reliable code to force a page break for printing purposes, how do you calculate the position of the code to force the break?

Have a client who would like database reports to be available as HTML but also printable in a structured way.

Page lengths would either Letter or A4.

TIA

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Hi

If that "structured way" means that those database reports are huge tables and the goal is to repeat the table headers and footers on each page, then use [tt]thead[/tt], [tt]tfoot[/tt] and [tt]tbody[/tt] and Mozillas ( FireFox, SeaMonkey, Epiphany, Galeon ) will repeat the table headers and footers on each page.


Feherke.
 
Feherke

Thanks for your reply.

Unfortunately the data output may not be in table format.

Having said that, if that's a way to control the page breaks, it might be possible to 'format' the output into table format.

What of other browsers?

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Hi

Chris said:
What of other browsers?
Presto ( Opera ), KHTML ( Konqueror ), WebKit ( Safari, Chorme, Midori, Arora ) seems that not supports it the sam way.

Maybe you are approaching the problem the wrong way. As I understand, you want to predict where will be the page breaks. Instead you should just specify where page breaks may/must be, then let the browser to break up the document based on the rendering and what you specified. See the [tt]page-break-before[/tt], [tt]page-break-after[/tt] and [tt]page-break-inside[/tt] properties in CSS 2.1 | Paged media | Page breaks.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top