Jump to content

Page Break in the right place for Printer Friendly Pages


coderb

Recommended Posts

Hi All,

 

I'm a bit stuck trying to figure how to ensure my page break is always in the correct position.

 

I'm using the CSS property -  page-break-after: always

 

I'm generating an html table with dynamic content. The table row can end up wrapping over two, sometimes more, lines depending on the content in a cell, which I obviously wont know in advance.

 

How on earth do I count the number of actual html generated rows, so that I can insert a printer friendly page break?

 

Any help appreciated, cheers.

 

 

actually, I should explain better

I have two tables, formatted one below the other.

 

the first table, with unknown dynamic content, can break over two pages no problem, however, the second table should not be split.

The good thing is the second table is fixed, so I will always know its length in printable rows, therefore if its length 6 rows, then all I need to do is ensure that there are 6 rows available on the page otherwise I insert a page break first.

 

So you can see the issue is knowing how many actual html lines the first table is going to be.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.