Follwing similer quesions like How to deal with page breaks when printing a large HTML table, I want to do the oppsite thing, is there a way using CSS
to set the page end point.
example:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
<style type="text/css">
.endOfThePage { } //some css to mark as the end of current page in print mode
</style>
</head>
<body>
<table>
<thead>
<tr><th>heading</th></tr>
</thead>
<tfoot>
<tr><td>notes</td></tr>
</tfoot>
<tbody>
<tr>
<td>x</td>
</tr>
<tr>
<td>x</td>
</tr>
<!-- 500 more rows -->
<tr>
<td>x</td>
</tr>
<div class = "endOfThePage"></div>
<!--some other stuff that will be printed on the next page -->
</tbody>
</table>
</body>
</html>
So at the end when the user clicks on print(window.print
) there will be 2 page, one the part before endOfThePage
div
and one with the rest of the page.
I hope that it is clear.