【问题标题】:Prevent Word Wrap In <TD> cell using tcpdf使用 tcpdf 防止 <TD> 单元格中的自动换行
【发布时间】:2011-05-23 00:05:12
【问题描述】:

我正在使用 TCPDF 将 html 表格转换为 PDF,并希望防止单个单元格换行文本。

我试过&lt;td style='white-space: nowrap;&gt; 没有运气。

有没有办法强制 tcpdf 不在单个 &lt;td&gt; 标签内换行?

【问题讨论】:

  • 你有没有机会找到答案?
  • 没有。我最终只使用基本结构元素和 CSS 完全重构了文档。

标签: tcpdf


【解决方案1】:

你没有正确关闭单引号,请查看

<td style='white-space: nowrap;>

将此代码更改为

$html ='<td style="white-space: nowrap;">';

然后将此变量写入 pdf 使用

$this->pdf->writeHTML($html, true, false, true, false, '');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-16
    • 1970-01-01
    • 1970-01-01
    • 2010-09-22
    • 2010-12-26
    • 2011-03-29
    • 1970-01-01
    • 2015-01-02
    相关资源
    最近更新 更多