Forum


Replies: 3   Views: 716
Set caption style for tables and images
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 ed.goode  · 01-11-2022 - 21:16

I'm creating a document from a template that has a lot of styles in it. The document that gets created has a lot of images and tables, each with a caption. They are being created fine, but I can't figure out how to set them to use the template's caption style.

This is the code I'm using to create tables:

$table_params = array(
            'tableStyle'=> 'TableGrid',
            'borderColor' => 'BFBFBF',
            'border' => 'single',
            'textProperties' => array('pStyle' => 'TableTextstandard'),
            'caption' => array('text' => $hbd_caption, 'position' => 'above', 'styleName' => 'Table')
);

What am I missing, or is it just not possible?