Slinky
Slinky

Reputation: 5832

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

Upvotes: 6

Views: 2262

Answers (1)

Slinky
Slinky

Reputation: 5832

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

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

See this for more...

Upvotes: 14

Related Questions