We have this page that the client uses for printing out some data onto paper. It loops through a list of MVC models, and every new iteration should be printed on a new page.
In cshtml I have built this (simplified):
@foreach (var header in Model.ReportHeaders)
{
<div style="page-break-after:always">
<div>
<img src="Logo-image-url" />
<h2>Misc Logo stuff</h2>
</div>
<div>Report header information</div>
<div>
<table>
<thead>
<th>Column headers</th>
<th>Column headers</th>
<th>Column headers</th>
</thead>
<tbody>
@foreach (var details in header.ReportDetails)
{
<td>All the data here</td>
<td>All the data here</td>
<td>All the data here</td>
}
</tbody>
</table>
</div>
</div>
}
But somehow, however I try to rearrange the page-break-after styling neither Chrome or IE wants to start on a new page when printing it. Am I using it incorrectly, or why doesn't it work as intended?