Replies: 3   Views: 3452
Tickcheckbox in dynamic table
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 Andrew Goodricke  · 15-10-2013 - 16:05

Is there a way to set tick the checkboxes like in: for a table?

We have a table that has checkboxes within the template row. e.g.

Table header row


The data I have is like:

$tableData = array(
'VAR_ROW_NAME' => 'Monday'
, 'CHECK_IS_OPEN' => 0
'VAR_ROW_NAME' => 'Tuesday'
, 'CHECK_IS_OPEN' => 1

$docx->addTemplateVariable($tableData, 'table', array('header' => false));

Thanks in advance.

Posted by jorgelj  · 15-10-2013 - 16:31


There's no support for that, but a workaround is to use placeholders and replaceTemplateVariableByHTML. Something like:

$html = '<input type="checkbox" checked>';

$docx->replaceTemplateVariableByHTML('CHECK_IS_OPEN', 'inline', $html);


Posted by Andrew Goodricke  · 16-10-2013 - 17:14