【问题标题】:How to set heigth of table row?如何设置表格行的高度?
【发布时间】:2015-06-18 16:16:11
【问题描述】:

我不想做任何花哨的事情,但表格中的每一行都有某种填充底部。看起来字符串末尾有一个\n。

+--------------------------------+ |First Cell | Second Cell | +--------------------------------+ |Other Cell | Other Really | | | Big Cell | +--------------------------------+

我正在使用扩展方法添加每一行,我尝试了以下 cmets,但它们没有按预期工作

public static void AddRow(this Table table, string[] cells)
{
    var row = table.AddRow();
    //row.HeightRule = RowHeightRule.Exactly;
    //row.Height = 20;
    //row.BottomPadding = 0;

    var i = 0;
    foreach (var cell in cells)
    {
        row.Cells[i].AddParagraph(cell);
        i++;
    }
}

【问题讨论】:

  • 也许你的文本末尾有一个\n,也许你的段落格式有一些 SpaceAfter 设置,也许是别的东西。提供完整的工作样本或 MDDDL 文件以供检查。另见:pdfsharp.net/wiki/MigraDocDDL.ashx

标签: c# pdfsharp migradoc


【解决方案1】:

正如@pdfsharp-team 指出的那样,有一个ParagraphFormat.SpaceAfter = 10; 引起了这个问题。

谢谢你,@pdfsharp 团队

【讨论】:

    猜你喜欢
    • 2020-03-24
    • 1970-01-01
    • 2011-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-20
    • 1970-01-01
    • 2011-11-23
    相关资源
    最近更新 更多