I am trying to fix an issue where the table header in my HTML is not rendering correctly on subsequent pages. Any ideas on how to fix this issue?
The header
<thead>
<tr>
<th></th>
<th>@Index.LastName</th>
<th>@Index.FirstName</th>
<th>@Index.Contact</th>
<th>@Index.Division</th>
<th>@Index.ClubName</th>
<th>@Index.Position</th>
</tr>
</thead>
The action:
public ActionResult PrintResults(UserMemberSearchViewModel model)
{
model.Results = UserMemberSearchTasks.Search(model);
return new PartialViewAsPdf("ResultsPDF", model)
{
FileName = Resources.UserMemberSearch.Index.MemberDetails + ".pdf",
};
}
The result
This solved the issue, which is caused by a bug in wktohtml, apparently.
<style>
tr { page-break-inside: avoid;}
</style>
See this for more...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With