php - How to use multiple style in PHPWord? -


actually using following code in phpword

$table->addcell(10500, $stylecell)->addtext('<span style="background-color:#003300;">test</span><span style="background-color:#00000;">dinesh</span>'); $table->addrow(); 

please solve problem...

you can achieve altering cell content coloring creating textrun , adding different colored parts separately:

$textrun = $table->addcell(10500, $stylecell)->addtextrun() $textrun->addtext(htmlspecialchars("test", ent_compat, 'utf-8'), array('color' => '003300')); $textrun->addtext(htmlspecialchars("dinesh", ent_compat, 'utf-8'), array('color' => '000000')); $table->addrow(); 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -