I am creating a html page and print it as receipt that is 75mm width and height 100mm. But I would like to make it to be auto height to fit my content. Please kindly help.
<?php
$qrString = $_GET['qrString'];
$tableNumber = $_GET['tableNumber'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>receipt</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
<link rel="stylesheet" href="../paper.css">
<style>
@page { size: 75mm 100mm } /* output size */
body.receipt .sheet { width: 58mm; height: 100mm } /* sheet size */
@media print { body.receipt { width: 58mm } } /* fix for Chrome */
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body class="receipt">
<section class="sheet padding-10mm">
<?php echo '<h1>檯號: '.$tableNumber. '</h1><br><br>' ?>
<img id='barcode'
src=<?php echo 'https://api.qrserver.com/v1/create-qr-code/?data=' .$qrString. '&size=300x300' ?>
alt=""
title="HELLO"
width="300"
height="300" />
</section>
</body>
<script type="text/javascript">
<!--
window.print();
</script>
</html>