I have two tables of size 7cm×15cm that I want to export to a pdf file, of A4 portrait paper size, using the browser's "Save to PDF" option in its print tool.
Ideally, I want to vertically center the two tables on the A4 paper. But if that is not possible to do, I would like them to be positioned on the same place in the page.
At the moment, for some reason, the two tables are not positioned at the exact place on the page, as I want them to (see in the image below).
The html code is the following:
<body>
<!-- 1st table: -->
<table>
<tr> <td>content of the first table</td>
<!-- some other tr's and td's -->
</tr>
</table>
<!-- 2nd table: -->
<table>
<tr> <td>content of the second table</td>
<!-- some other tr's and td's -->
</tr>
</table>
</body>
together with the following css rules:
table {width:7cm; height:15cm; border: 1px solid;
page-break-after: always;
margin: auto;
}
@media print {
@page { size: A4 portrait; }
}
The page-break-after: always; rule instructs the browser to insert a page break after the table;
The margin: auto; rule horizontally aligns the tables on the canvas.
I need to print the two tables on the same paper, in a two-sided printing, so that the tables are printed just behind each other.
What I have at the moment:
Any help would be much appreciated!




