Printing HTML blocks
Posted
by Lem0n
on Stack Overflow
See other posts from Stack Overflow
or by Lem0n
Published on 2010-04-05T04:03:27Z
Indexed on
2010/04/05
4:13 UTC
Read the original article
Hit count: 345
I have a page with a few tables that I want to be printable. I want the following behaviour:
1) Add a page break if the next table fits in a single page, but won't fit in the current page (because of other stuff already printed on this page)
2) Print the "table header" again in case it's needed to break a table (I guess it's the default behaviour)
Any ideas specially on the first issue? Maybe some CSS can help?
I'll give on example. I have a page with 4 tables. All of them with 10 lines, except the third one, with 50 lines. The first and second goes on the first page. Since the third one won't fit in the same page, but will fit in a page alone, it's printed on a page alone... and then the forth table is printed on the third page (in case it doesn't fit together in the second page).
But, if the third page had 300 lines and would be broke anyway, it could have started to be print in the first page.
© Stack Overflow or respective owner