I creating a report with html and css for use on my python flask app.
This report will be dynamic about the amount of pages, can be 4 or 30.
On my template i put a simple header and footer to stay in all pages, but this only works on Firefox and Google Chrome, using a CTRL + P and print.
To create the pdf, im using python with pdfkit, using this guy the header and footer appears only firt page the other pages are printed without this header and footer.
Theres some way to fix this using CSS or html ?
This is my html code.
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Report Demo</title>
<style>
</style>
</head>
<body>
<header>
<div class="container" style="margin-top: 8px;">
<div class="div-logo">
<img src="logo.png" style="float: left;" width="120px" height="40px">
</div>
<div class="div-date-report">
<div style="width: 100%;">
<span style=" font-size: 12px; text-align: right; font-family: 'Times New Roman', Times, serif;">
<span>
</div>
</div>
</div>
<div class="line" style="border-bottom: #e0e0e0 solid 2px; margin-top: 25px;"> </div>
</header>
<main>
<p>
<h2>Title Report</h2>
<ul>
<li>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</li>
<li>
<img src="#" class="chart-img">
</li>
</ul>
</p>
</main>
<footer style="border-top: 1px solid #e0e0e0; color: black;">
<p style="width: 90%; margin-left: 20px; font-size: small; ">© My report Footer <span style="float: right;">www.myreportwebsite.com</span></p>
</footer>
</body>
</html>