【问题标题】:phpword Table vmerge and gridspanphpword表vmerge和gridspan
【发布时间】:2015-04-30 11:15:48
【问题描述】:

我正在尝试使用PHPWord 创建一个表,该表应该是这样的: 有些行包含 2 个单元格,有些行包含 4 个单元格

------------------------
|     |                | 
|-----------------------
|     |                |
------------------------
|     |     |     |    |                
|-----------------------

这是我的代码的一部分

    $table->addRow(200);
    $table->addCell(2000, $styleTitleCell)->addText(htmlspecialchars('text'), $fontTitle);
    $table->addCell(15000, $styleCell)->addText(htmlspecialchars('textVULN'), $fontTitle);

    $table->addRow(600);
    $table->addCell(2000, $styleTitleCell)->addText(htmlspecialchars('Référence'), $fontTitle);
    $table->addCell(15000, $styleCell)->addText(htmlspecialchars(' text'), $fontStyle);

    $table->addRow(600);
    $table->addCell(2000, $styleTitleCell)->addText(htmlspecialchars('text'), $fontTitle);
    $table->addCell(15000, $styleCell)->addText(htmlspecialchars('constats ici'), $fontStyle);

    $table->addRow(600);
    $table->addCell(2000, $styleTitleCell)->addText(htmlspecialchars('text'), $fontTitle);
    $table->addCell(15000, $styleCell)->addText(htmlspecialchars('text'), $fontStyle);
    //elements impactés
    $table->addRow(600);
    $table->addCell(2000, $styleTitleCell)->addText(htmlspecialchars('Eléments impactés'), $fontTitle);
    $table->addCell(15000, $styleCell)->addText(htmlspecialchars('Les elements ici'), $fontStyle);


    $table->addRow(600);
    $table->addCell(2000, $styleTitleCell)->addText(htmlspecialchars('text'), $fontTitle);
    $table->addCell(15000, $styleCell)->addText(htmlspecialchars('text'), $fontStyle);


    $table->addRow(600);
    $table->addCell(2000, $styleTitleCell)->addText(htmlspecialchars('text'), $fontTitle);
    $table->addCell(2000, $styleCell)->addText(htmlspecialchars('text'), $fontStyle);
    $table->addCell(2000, $styleTitleCell)->addText(htmlspecialchars('text'), $fontTitle);
    $table->addCell(2000, $styleCell)->addText(htmlspecialchars('text'), $fontStyle);

这就是我得到的:

----------------------
|     |              | 
|---------------------------------
|     |              |     |     |
----------------------------------

【问题讨论】:

  • 找到了,我必须添加 array('gridSpan' => 3) ($table->addCell(15000, array('gridSpan' => 3))->addText(htmlspecialchars(' text'), $fontTitle);)
  • 写一个答案并将其标记为已解决。

标签: php codeigniter phpword


【解决方案1】:

找到了,我必须添加 array('gridSpan' => 3) ($table->addCell(15000, array('gridSpan' => 3))->addText(htmlspecialchars('text'), $字体标题);)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-10
    • 1970-01-01
    • 1970-01-01
    • 2017-06-07
    • 2012-12-27
    • 2012-07-10
    • 2017-02-19
    相关资源
    最近更新 更多