When utilizing the print function of various browsers to save web content in a PDF file, I have observed that each browser behaves differently. This becomes an issue when the content spans multiple pages. For instance, Chrome prints correctly while Safari fails to include the table header on each page and Firefox only prints the header without any content on the first page. However, the second page contains both the header and content, resulting in it needing one additional page compared to the other two browsers.
To test this behavior, I used a simple HTML table and Lorem Ipsum text with 1000 words. The challenge lies in achieving consistent behavior across all browsers when using the print function. Ideally, I would like the behavior seen in Chrome. Do you know how I can ensure uniform printing behavior?
<!DOCTYPE html>
<html>
<head>
<title>Your Title Here</title>
</head>
<body>
<table class="main_table">
<thead>
<tr>
<th>Title</th>
</tr>
</thead>
<tbody>
<tr>
<td>
// Lorem Ipsum text
</td>
</tr>
</tbody>
</table>
</body>
</html>