Forum


Replies: 4   Views: 4721
Table cell horizontal alignment and addfootnote
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  · 19-07-2016 - 06:51

Hello,

You just need to add a WordFragment that set the cell content position as middle adding its text and a footnote. The WordFragment must have both contents.

Regards.

Posted by neiron  · 19-07-2016 - 09:09

Super. Thank you!!!

It happened here and so

// footnote
    $footnote = new WordFragment($docx, 'document');
    $footnote->addFootnote(
      array(
        'textDocument' => 'footnote',
        'textFootnote' => 'The footnote we want to insert.',
      )
    );
    
    // table
    $textFragment = new WordFragment($docx);
    $text = array();
    $text[] = $footnote;

    $paragraphOptions = array(
      'textAlign' => 'center',
    );
    $textFragment->addText($text, $paragraphOptions);
    $valuesTable = array(
      array(
        $textFragment,
      ),
      array(
        '2',
      ),
      array(
        '3',
      ),
    );

    $docx->addTable($valuesTable);

 

Posted by neiron  · 19-07-2016 - 12:13

But not working:

 

$paragraphOptions = array(
   'textAlign' => 'center',
   'bold' => TRUE
);

Text centered, but not bold. Please help me

 

Posted by admin  · 19-07-2016 - 14:24

Deleted by admin · 13-05-2022 - 15:49