Problem with @media print
It contains a header, a section, and a footer. Why, when my table has many rows, can it not break and print on the next page in the section?
Code
@media print {
@page {
margin: 10px;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 300px;
}
.footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 240px;
}
.section {
margin-top: 300px;
margin-bottom: 250px;
padding-top: 10px;
height: 580px;
}
.table-container {
overflow-x: visible;
max-height: 100%;
page-break-inside: avoid;
}
}
<!-- Header -->
<div class="header">
<!-- Your header content here -->
</div>
<!-- Section -->
<div class="section">
<div class="table-container">
<table>
<!-- Your table content here -->
</table>
</div>
</div>
<!-- Footer -->
<div class="footer">
<!-- Your footer content here -->
</div>
Now, Result
I want the result to be
- Numbers 1-13 will be printed on the first page,
- and numbers 14-17 will be printed on the second page.