Fit a html table in A4 size
<p>I have a html file with a wide table. I want to be able to put it in a A4 size. The columns that exceed the A4 size should come below in a new table. </p>

<p>I tried using this the @page attribute, but it didn't change anything,</p>

<pre><code>&lt;style type="text/css"&gt;
    @page {    size: 21cm 29.7cm; margin: 30mm 45mm 30mm 45mm; }
&lt;/style&gt;
</code></pre>

<p>Is there any third party js library that automatically does this? (The table size is not known before hand, the user uploads data and generates the table, so the number of columns is not fixed). {My end goal is to print this as a pdf, but I could not achieve this using the qprinter given in QT}</p>

<p>I have put a html file with long table here - <a href="https://plnkr.co/edit/Lha6immBGUS7pTfDaJ43?p=preview" rel="noreferrer">link</a>.</p>

<p>Thanks in advance </p>