I am printing a large table which is 100 rows x 100 columns, however it doesn't automatically page-break.
What I wanted to happen is to format the print output displaying the complete columns and with its defined width and font size. I managed to print the complete rows however, the other columns are missing.
What I am using is Google Chrome.
My code
<html>
<head>
<title>sdfsfsdf</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
table {
border-collapse: collapse;
page-break-inside:auto
}
tr {
page-break-inside:avoid;
page-break-after:auto
}
thead {
display:table-header-group
}
th, td {
border: black 1px solid;
padding-left: 5px;
padding-right: 5px;
min-width: 200px;
}
@page {
size: legal landscape;
margin: 1cm;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<?php
// table headers
for($x=1 ; $x<=100; $x++) {
echo '<th>Header ' . $x . '</th>';
}
?>
</tr>
</thead>
<tbody>
<?php
//table body data
for($y=1 ; $y<=100; $y++) {
echo '<tr>';
for($x=1 ; $x<=100; $x++) {
echo '<td>data ' . $y . ' - '. $x . '</td>';
}
echo '</tr>';
}
?>
</tbody>
</table>
</body>
</html>