Forum


Replies: 6   Views: 4126
How to bold text in a cell in a table
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 mightycpa  · 20-04-2013 - 05:25

I saw where you can choose the font and other characteristics for the text in a table cell.  What about making text bold in a table cell?



How is it done?



Tx,



mightycpa


Posted by jorgelj  · 22-04-2013 - 09:51

Hello,



What version of PHPDocX are you using?.



Regards.


Posted by mightycpa  · 22-04-2013 - 18:41

Hi,



Freebie right now.  But in any case, free or otherwise, this does not appear to be addressed in the docs online.


Posted by jorgelj  · 23-04-2013 - 09:09

Hello,



You can do that using PHPDocX Pro version with addTable method and others.



Regards.


Posted by mightycpa  · 23-04-2013 - 18:40

Hi Jorge,



Two things, and please forgive my lack of precision in my question earlier:



1) the ability to do this seems not to reside in a key (e.g., "b" in addText function ), but in the more generalized TBLSTYLEval key - I suppose this gives you wider latitude.



2) I meant to add bold for one individual cell.  In your examples on page http://www.phpdocx.com/api-documentation/word-content/add-table-Word-document-with-PHP, it seems that this ability is limited to a TABLE, and does not extend to the individual cell.  It looks like there are some things you can do with individual cells, but BOLD is not one of them.



Am I missing something or is that the way it works?


Posted by jorgelj  · 24-04-2013 - 12:38

Hello,



You can use addText method for each cell, so you'll be able to set custom styles per each cell of a table. Other way is to use DOCX as a template or import styles from an existing table.



Regards.