Witam,
Chcę wydrukować tabelę napisaną w HTML, która ma dużo kolumn ale podczas druku ucina mi jej część. Próbowałem dodać zapytania @media do druku ale chyba coś źle robię. Szkielet tabeli wygląda następująco:
<style>
table {
width: 100%;
border-collapse: collapse;
text-align: center;
}
thead{
background-color: #c0c0c0;
}
table, th, td{
border: 1px solid black;
padding: 10px;
}
table tbody tr:nth-child(even){
background-color: #eaeaea;
}
@media print {
@page {size: A4 ;max-height:100%; max-width:100%}
.table-box table {page-break-inside: avoid}
}
</style>
<div class="table-box">
<table>
<thead>
<tr>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th colspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
<th colspan="2"></th>
<th rowspan="2"></th>
<th rowspan="2"></th>
</tr>
<tr>
<th>od</th>
<th>do</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>