これが私のphpページの大まかな構造です-
<table>
<tr>
<th> header 1 </th>
<th> header 2 </th>
</tr>
foreach (values as value) {
<tr>
<td> column 1 </td>
<td> column 1 </td>
</tr>
/* Here if condition is true and media=print I want to close the table, add a page break and start a whole new table as below so the page prints nicely */
if (condition) {
</table>
<div style='page-break-after:always;'> </div>
<table>
<tr>
<th> header 1 </th>
<th> header 2 </th>
</tr>
}
}
media=print かどうかを確認し、テーブルに改ページを追加する方法はありますか (おそらく javascript で)。
ご協力ありがとうございました。