Witajcie, mam kolejny problem przy projekcie.
Oto mój kod. Problem mam taki iż przy drukowaniu nie mam pokazanych lini tabeli, ktoś wie czy bootstrap coś blokuje, czy jak to jest ?
<style>
td{
white-space:pre-line;
}
</style>
<script type="text/javascript">
function PrintElem(elem)
{
Popup($(elem).html());
}
function Popup(data)
{
var mywindow = window.open("", "to_print", "height=600,width=600");
var html = "<html><head><title></title></head>"+
"<body onload=window.focus(); window.print(); window.close()>"+
'<link rel="stylesheet" type="text/css" href="css/dist/css/bootstrap.min.css" /><link href="css/style.css" rel="stylesheet">'+
data+
"</body></html>";
mywindow.document.write(html);
mywindow.print();
mywindow.document.close();
return true;
}
</script>
<div class="row">
<div class="col-md-12">
<div id="printable">
<table class="table table-bordered">
<thead>
<tr>
<th>Lp</th>
<th>Data</th>
<th>Dane do wysyłki</th>
<th>Dane do Faktury</th>
<th>Nazwa towaru</th>
<th>ilość</th>
<th>Cena</th>
<th>Przesyłka</th>
<th>Razem wpłat</th>
<th>Rodzaj wpłaty</th>
<th>Data wpłaty</th>
<th>Status</th>
<th>Data wysyłki</th>
</tr>
</thead>
<tbody>
<?php
{
echo '<td>'.$tabela['id'].'</td>'; echo '<td>'.$tabela['date_purchase'].'</td>'; echo '<td style="width:150px;">'.$tabela['dane'].'</td>'; echo '<td style="width:150px;">'.$tabela['invoice'].'</td>'; echo '<td>'.$tabela['commodity'].'</td>'; echo '<td><center>'.$tabela['quantity'].'</center></td>'; echo '<td><center>'.$tabela['price'].'</center></td>'; echo '<td><center>'.$tabela['consignment'].'</center></td>'; echo '<td><center>'.$tabela['consignment'].'</center></td>'; echo '<td><center>'.$tabela['platnosc'].'</center></td>'; echo '<td><center>'.$tabela['date_payment'].'</center></td>'; }
?>
</tbody>
</table>
</div>
<br>
<button onclick="PrintElem('#printable')" alt="print"">drukuj</button>
</div>
</div>
</div> <!-- /container -->
Ten post edytował Play12 6.01.2018, 14:55:56