OL Learn

How to supress a pagebreak on some lines (widow/orphan)

I have a script building a table, using “

” at the beginning of each added row. The table breaks as expected, when a row would go past the allowed margin. However, sometimes I have a table line that is a one or two line subhead for following lines, and I want those to wrap with the following lines. IE: “wrap anywhere after table rows 1-n, but do not break after line n+1, n+2, n+3; then resume normal wrap behavior.” Basically this is keep the subhead on line n+1 and n+2 with at least one following line (n+3) before wrapping. I would be OK with wrapping either before or after the subhead.
If I leave off the data-breakable “” the whole line does not print.

this is using

, which was supressed in posting.

OK, try again. This used “.<.t.r. d.a.t.a.-.b.r.e.a.k.a.b.l.e.=.”.”.>.”

When you wan to show this: <data-breakable>
You need to write it like this: &lt;data-breakable&gt;

Rough solution:

Increment LineCount each time a line is added to the table.
After each line is added, execute either function bodywrap() or headingwrap(), depending on whether I am adding a subheading or body line.
Function bodywrap will wrap by appending a “page-break-before: always” line if we are on page 1 and at line 43 or greater, or line 59 on page 2 or greater, and also increment the page count and set line count back to 1.
Headingwrap is the same as bodywrap except it kicks in at line 40 or 56, so that a heading will wrap a little sooner; we don’t want a heading followed by one or no lines before wrapping.

Hi hamelj,

In connection to this topic. Is there a way to prevent a content to overflow completely and just simply cuts off in the current page?

I have a simplex notice statement that has dynamic table in the front page. The table is created via script (manually), I dont want it to create another page when it overflows.

Actually It seems like I have resolved this.

By putting the table inside an absolute positioned div. Now Im able to prevent the tables from overflowing on to the next page.

Cheers.