Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rotativa - Strange Header Output

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

enter image description here

like image 772
Slinky Avatar asked Jul 06 '15 14:07

Slinky


1 Answers

This solved the issue, which is caused by a bug in wktohtml, apparently.

<style>
      tr { page-break-inside: avoid;}
</style>

See this for more...

like image 191
Slinky Avatar answered Sep 19 '22 09:09

Slinky