HTML DOM pageBreakAfter Property
Complete Style Object Reference
Definition and Usage
The pageBreakAfter property sets the page-break behavior after an element.
Syntax
Object.style.pageBreakAfter=auto|always|avoid|left|right
|
Possible Values
Value |
Description |
auto |
Insert a page break after the element if necessary |
always |
Insert a page break after the element |
avoid |
Avoid inserting a page break after the element |
left |
Insert page breaks after the element until it reaches
a blank left page |
right |
Insert page breaks after the element until it reaches
a blank right page |
Tips and Notes
Note: You cannot use this property on absolutely positioned elements.
Note: Use the page-break properties as few times as possible and
avoid page-breaking properties inside tables, floating elements, and block
elements with borders.
Example
The following example always sets a page-break after the paragraph with id of
p1:
<html>
<head>
<script type="text/javascript">
function setPageBreak()
{
document.getElementById("p1").style.pageBreakAfter="always";
}
</script>
</head>
<body>
<p id="p1">This is a test paragraph.</p>
<input type="button" onclick="setPageBreak()"
value="Set page-break" />
<p>This is also a test paragraph.</p>
</body>
</html>
|
Complete Style Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|