I'm using https://github.com/Xportability/css-to-pdf to load HTML tables into a PDF. All is working fine except for being able to insert page breaks between the tables. Using this code:
<!doctype html>
<html lang="us">
<head>
<meta charset="utf-8">
<title>XEPjqPlugin</title>
<style>
@media print {
.noprint {display:none;}
.print {width:100%; display:table-header-group;}
body, article {width: 100%; margin: 0; padding: 0; font-size: 10pt; font-family:'Times New Roman',Times,serif;}
table { page-break-after: always;}
}
</style>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/xepOnline.jqPlugin.js"></script>
</head>
<body>
<div class="report">
<div id="tablePage">
<input class="noprint" name="tablepage" type="checkbox">
<a class="noprint nodec" id="printit" href="#"
onclick="return xepOnline.Formatter.Format('tablePage',{pageMargin:'0.5in'});"
><img src="css/Images/button-print.png" />
<div>
<table id="table1" border="1">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td rowspan="2">Row 1 Cell 1</td>
<td>Row 1 Cell 2</td><td>Row 1 Cell 3</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td colspan="3">Row 3 Cell 1</td>
</tr>
</table>
</div>
<div>
<table id="table2" border="1">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td rowspan="2">Row 1 Cell 1</td>
<td>Row 1 Cell 2</td><td>Row 1 Cell 3</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td colspan="3">Row 3 Cell 1</td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>
The @media print style isn't having any effect. The .noprint and page-break have not effect.
An update to the source has been posted. There was a bug reading the embeded @media style from the current document. I've tested this issue and it is now resolved. For future bug reports, please report in Git. Thanks. Git project located here: https://github.com/Xportability/css-to-pdf