Forum


Replies: 3   Views: 3250
Table in header
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 supriyshah  · 19-06-2013 - 14:28

Hi,



I am trying to add a single row table in the header. Following is the code I am using:



$headertable=array(

    array(

        $leftHeader, //text

        $centralHeader, //text

        $rightHeader //image

    )

);



$headeroptions = array('size_col' => array(2120,6656,2120), 'border' => 'single', 'border_sz' => 10);

$finalheader=$docx->addTable($headertable,$headeroptions);

$headerWordML = $docx->createWordMLFragment(array($finalheader));

$docx->addHeader(array('default' => $headerWordML));




The table is being generated but not as a part of the header. If I add  'rawWordML' => true to $headeroptions, the array moves to the header but does not show as table. Everything is scattered and the image disappears.



What am I doing wrong?