如何在PHPWord上更改styleTable? [英] How to change styleTable on PHPWord?

查看:675
本文介绍了如何在PHPWord上更改styleTable?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用插件phpword时遇到问题.我正在尝试更改样式,但可以更改单元格的背景,并考虑其他参数.

I have a problem with using the plugin phpword. I'm trying to change the style, but I can change the background of the cell and other parameters are considered by it.

$styleTable = array('borderColor'=>'006699',
                    'borderSize'=>6,
                    'cellMargin'=>50,
                    'valign'=>'center'
                   );
$styleFirstRow = array('bgColor'=>'6086B8',
                       'color'=>'white',
                       'bold'=>true,
                       'size'=>11,
                       'valign'=>'center'
                    );
$PHPWord->addTableStyle('myTable', $styleTable, $styleFirstRow);

如果您想查看我的代码,请按以下步骤操作: http://pastebin.com/pw36n3aW

If you want to look my code, he as here : http://pastebin.com/pw36n3aW

推荐答案

我找到了问题所在,它来自我不存在的设置. 谢谢您的时间和帮助.

I found where the problem was, it came from my settings that do not exist. Thank you for your time and help.

$styleFirstRow = array('bgColor'=>'#6086B8');
    $PHPWord->addTableStyle('myTable', $styleTable, $styleFirstRow);

    $styleCellFirstRow = array('valign'=>'center'); 
    $styleCell = array('valign'=>'center'); 

$styleTextFirstRow = array('name'=>'Lucida Sans Unicode', 'color'=>'white','size'=>12);
    $styleParagprapheFirstRow = array('align'=>'center');
    $table->addCell(2200, $styleCellFirstRow)->addText('Type du rapporteur', $styleTextFirstRow, $styleParagprapheFirstRow);

这篇关于如何在PHPWord上更改styleTable?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆