Вопросы, связанные с подобным образом Follwing, такие как How to deal with page breaks when printing a large HTML table, я хочу сделать oppsite вещь, есть способ использовать CSS
, чтобы установить конечную точку страницы. пример:CSS - установить конец текущей страницы при печати
<!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>
Таким образом, в конце концов, когда пользователь нажимает на печать (window.print
) будет 2 страницы, одна часть перед endOfThePage
div
и один с остальной частью страницы.
Я надеюсь, что это ясно.
это помогает? http://www.w3schools.com/cssref/pr_print_pageba.asp – itdoesntwork
https://jsfiddle.net/vfocw4Lv/ –
Неужели мне не хватает чего-то? –