Pregunta

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);

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

¿Fue útil?

Solución

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);

Otros consejos

I am not sure but you can try this

array('borderColor'=>array('rgb' => '006699'), .....

Do you have this line in your code

$table = $section->addTable('myOwnTableStyle');

I think you need # to define color code

    $styleTable = array('borderColor'=>'#006699',....and so on
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top