Forum


Replies: 1   Views: 3831
How do i set the font color for a cell/row with addtable?
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by jamie3000  · 24-10-2016 - 13:51

Hi Guys,

I'm using the trail version (which I think is Pro) and I'm creating a cell/row with AddTable but I'd like to change the foreground font but can't see how in the docs or examples?

$valuesTable[] = array(array('value' => $BenefitData['HeaderForTable'], 'colspan' => '2', 'backgroundColor' => '2E74B5'));

I see options such as backgroundColor but no color or foregroundColor?

How can I do this?

Thanks!

Jamie

Posted by admin  · 24-10-2016 - 16:40

Hello,

You need to add text WordFragments as cell values, that allow to use these options to set colors: color and highlightColor.

We recommend you to read the available tutorial about WordFragments on:

http://www.phpdocx.com/documentation/practical/wordfragments-and-wordml

And the API doc and the available examples in the package of these methods:

http://www.phpdocx.com/api-documentation/word-content/add-paragraph-text-Word-document-with-PHP

http://www.phpdocx.com/api-documentation/word-content/add-table-Word-document-with-PHP

Although working with WordFragments is very easy, after you have puchased a license, the dev team can send you a simple sample to illustrate how to do it.

Regards.