0
I’m developing a basic hotel control system.
When registering the guest’s entry in a suite, I need to print a "receipt" for the customer, but putting only the function window.print()
Javascript is not printing as you would like.
The image below shows how the layout page and how the print is coming out (right).
The contents of the entire receipt inside a div
containing other Divs inside, as I am assembling the system with Bootstrap and it is necessary to insert the Divs to use the Bootstrap grids (responsive tables). Follows basic structure of div
in question:
<div id="recibo" class="container-fluid">
<div class="row" style="background-color:#d7d8da;">
<div class="col-md-12 text-center">Comprovante de Entrada em Suíte</div>
</div>
<div class="row" style="background-color: initial;">
<div class="col-sm-12 text-center">
<br>
</div>
</div>
<div class="row" style="background-color: initial;">
<div class="col-sm-6 text-center">
<b>Número da Suíte</b>
</div>
<div class="col-sm-6 text-center">
<?php
echo $num_suite;
?>
</div>
</div>
</div>
Is there any way to have it printed preserving all the layout page the way it is on the left side of the image (HTML, CSS etc)?
If you add the CSS file again indicating
media
asprint
, what happens? Something like:<link rel="stylesheet" type="text/css" href="style.css" media="print" />
– Woss
see if these tips can help you https://tableless.com.br/dicas-de-css-para-print/
– user60252
Apparently I can not even, I am since yesterday searching trying to find an alternative and I can not find anything that allows to print colored, it seems that it is standard to print ignore all the CSS of the page.
– Leandro