首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >phpword表vmerge和gridspan

phpword表vmerge和gridspan
EN

Stack Overflow用户
提问于 2015-04-30 19:15:49
回答 1查看 1.6K关注 0票数 2

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

代码语言:javascript
复制
------------------------
|     |                | 
|-----------------------
|     |                |
------------------------
|     |     |     |    |                
|-----------------------

这是我的代码的一部分

代码语言:javascript
复制
    $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);

这就是我所得到的:

代码语言:javascript
复制
----------------------
|     |              | 
|---------------------------------
|     |              |     |     |
----------------------------------
EN

回答 1

Stack Overflow用户

发布于 2015-05-04 20:05:05

找到它,我必须添加数组(‘gridSpan’=> 3) ($table->addCell(15000,array('gridSpan‘=> 3))->addText(htmlspecialchars('text'),$fontTitle);)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29966278

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档