First thing i will let you know that there is no guarantee that a html page may fit to a A4 size because, all designs made for various screens and not for the A4 size.
If you want to make it to work for A4 sized always then set the table size same for the A4 size and
then go for the operation and it should work for you.
And for exporting the html table data to escel report you can refer the below links already explains this :-
How to export HTML table to Excel[
^]
Hope this will definitely of help.