Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <style> @media print { table { page-break-inside: avoid; } tr { break-inside: avoid; } tbody { display: block; } tbody tr:nth-child(5n + 1) { page-break-before: always; } } </style> </head> <body> <table> <thead> <tr> <th>Column 1</th> <th>Column 2</th> <th>Column 3</th> </tr> </thead> <tbody> <tr> <td>Row 1, Column 1</td> <td>Row 1, Column 2</td> <td>Row 1, Column 3</td> </tr> <tr> <td>Row 2, Column 1</td> <td>Row 2, Column 2</td> <td>Row 2, Column 3</td> </tr> <tr> <td>Row 3, Column 1</td> <td>Row 3, Column 2</td> <td>Row 3, Column 3</td> </tr> <tr> <td>Row 4, Column 1</td> <td>Row 4, Column 2</td> <td>Row 4, Column 3</td> </tr> <tr> <td>Row 5, Column 1</td> <td>Row 5, Column 2</td> <td>Row 5, Column 3</td> </tr> <tr> <td>Row 6, Column 1</td> <td>Row 6, Column 2</td> <td>Row 6, Column 3</td> </tr> <tr> <td>Row 7, Column 1</td> <td>Row 7, Column 2</td> <td>Row 7, Column 3</td> </tr> <!-- and so on... --> </tbody> </table> </body> </html>