I use wkhtmltopdf with footer.html , header.html and use border in main html code. But when I use border table side lines be longer than table. How can I fix it ? Example table
main.html
<style type="text/css">
span {
font-family: arial;
font-size: 12px;
font-weight: bold;
}
tr {
page-break-inside: avoid;
}
table {
font-family: arial;
font-size: 9px;
width: 100%;
}
</style>
<table cellpadding="0" cellspacing="0" border="1">
<thead>
<tr>
<th>İL <br />İLÇE</th>
<th>BİNA ADI</th>
<th>AÇIKLAMA</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@(item != null && item.IL != null ? item.IL : "")<br /> @(item != null && item.ILCE != null ? item.ILCE : "")</td>
<td>@(item != null && item.BINA_ADI != null ? item.BINA_ADI : "")</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="7"><b>TOPLAM :</b></td>
<td colspan="5"><b>@toplam</b></td>
</tr>
</tfoot>
</table>
header.html
<!DOCTYPE html>
<html>
<head>
<META http-equiv=content-type content=text/html;charset=iso-8859-9>
<META http-equiv=content-type content=text/html;charset=windows-1254>
<META http-equiv=content-type content=text/html;charset=x-mac-turkish>
<style type='text/css'>
table, tr, td, th, tbody, thead, tfoot {
page-break-inside: avoid !important;
}
</style>
</head>
<body style=" margin:0;padding-top:20px; font-family: Courier New; font-size: 8pt;text-align: justify;">
</table>
<table style='width: 100%; text-align: justify; margin-top:80px;' cellpadding='0' cellspacing='0'>
</body>
</html>
footer.html
<!DOCTYPE html>
<html>
<head>
<META http-equiv=content-type content=text/html;charset=iso-8859-9>
<META http-equiv=content-type content=text/html;charset=windows-1254>
<META http-equiv=content-type content=text/html;charset=x-mac-turkish>
<script>
function subst() {
var vars={};
var x=document.location.search.substring(1).split('&');
for (var i in x)
{
var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);
}
var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
for (var i in x)
{
var y = document.getElementsByClassName(x[i]);
for (var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
}
}
</script>
</head>
<body style="margin:0;padding-top:50px;" onload="subst()">
<table style="width: 100%">
<tr>
<td style="text-align:center;width:20%;">
<span class="page"></span> / <span class="topage"></span>
</td>
</tr>
</table>
</body>
</html>