Forum


Replies: 1   Views: 2355
Styling individual table cells
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 admin  · 02-08-2019 - 17:22

Hello,

You can add almost any content into cells using WordFragments (text with styles, lists, charts, images, HTML...), we recommend you to check the samples included in the package (core/addTable folder) and the samples available on https://www.phpdocx.com/api-documentation/word-content/add-table-Word-document-with-PHP (example #2). About WordFragments, please check the documentation available on https://www.phpdocx.com/documentation/practical/wordfragments-and-wordml. WordFragments are one of the most powerful features available in phpdocx.

About the table width, by default MS Word handles the width. To change this, you just need to set 'tableLayout' as 'fixed' when using addTable or use a custom table style. On https://www.phpdocx.com/api-documentation/word-content/add-table-Word-document-with-PHP you can read more information about this and other options available in the method.

Regards.