c# - Rotativa - 奇怪的 header 输出

标签 c# asp.net-mvc-3 wkhtmltopdf rotativa

我正在尝试解决我的 HTML 中的表格标题在后续页面上无法正确呈现的问题。关于如何解决此问题的任何想法?

标题

 <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>

Action :

public ActionResult PrintResults(UserMemberSearchViewModel model)
{
    model.Results = UserMemberSearchTasks.Search(model);
    return new PartialViewAsPdf("ResultsPDF", model)
    {
        FileName = Resources.UserMemberSearch.Index.MemberDetails + ".pdf",

    };
}

结果

enter image description here

最佳答案

这显然是由 wktohtml 中的错误引起的问题。

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

参见 this更多...

关于c# - Rotativa - 奇怪的 header 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31248889/

相关文章:

asp.net-mvc-3 - 请参阅 Controller 中的验证摘要

asp.net-mvc - Azure 网站和 wkhtmltopdf

c# - 如何在调试 C# 和 vs2012 期间停止秒表

c# - Sitecore 项目 :created vs item:added

c# - C#中的线程安全增量

c# - 可序列化继承

c# - 如何使用 knockoutjs 实用程序将 JS 对象转换为 JSON 以将 json 数据发送到 asp.net mvc 中的服务器?

javascript - 在 MVC3 中有条件地填充局部 View 控件

php - 使用 wkhtmltopdf 将当前页面打印为 pdf

c# - 未显示将 HTML 转换为 PDF 的精确副本