Forum


Replies: 13   Views: 2409
How to use phpdocx_section?
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  · 20-11-2019 - 15:21

Hello,

phpdocx_section is included as a sample in Core/embedHTML/sample_6.php. This tag, as others from HTML Extended, works in the same way, this is using the options of the related method (addSection in this case).

MS Word allows generating sections on the same page using the continuous option. This is a simple sample (we recommend creating a single section for each embedHTML calling to simplify its use):

$html = '<p>Text</p>';
$docx->embedHTML($html, array('useHTMLExtended' => true));

$html = '
<phpdocx_section data-sectionType="continuous" data-paperType="A4" data-numberCols="3" />
<p>More text</p>
';
$docx->embedHTML($html, array('useHTMLExtended' => true));

$html = '
<phpdocx_section data-sectionType="continuous" data-paperType="A4" data-numberCols="1" />
<p>More text</p>
';
$docx->embedHTML($html, array('useHTMLExtended' => true));

Regards.