Hello,
A table can't be replaced as an inline element or you'll only get its inline text. You must do a block replacement for tables and other block elements:
$docx->replaceVariableByHTML('CHUNK_2', 'block', $html, array('isFile' => false, 'parseDivsAsPs' => true, 'downloadImages' => false));
All samples available in the package and on the website use block replacements when replacing a placeholder with a table HTML.
We recommend you to read the tutorial page about HTML to DOCX (https://www.phpdocx.com/documentation/introduction/html-to-word-PHP); from this page:
The type of substitution that may be:
block: The whole paragraph containing the variable is replaced by the corresponding HTML.
inline: Only the variable itself is replaced by the inline HTML content (block elements are removed from the code).
Regards.