When I use Html reader for my html for converting into docx, reader is cut off my table.
PHP example:
$reader = IOFactory::createReader(\'HTML\');
$p
This answer is a comment of this Aviran Post : https://stackoverflow.com/a/40600565/6635967 (I don't have enought reputation to comment).
I tried his method and I had this error :
Attempted to call an undefined method named "addText" of class "PhpOffice\PhpWord\Element\Table".
To fix this, I had to modified the parseText function like this :
private static function parseText($node, $element, &$styles)
{
$elementStyles = self::parseInlineStyle($node, $styles['font']);
$textStyles = self::getInheritedTextStyles();
$paragraphStyles = self::getInheritedParagraphStyles();
// Commented as source of bug #257. `method_exists` doesn't seems to work properly in this case.
// @todo Find better error checking for this one
if (method_exists($element, 'addText') || $element instanceof Cell ) {
$element->addText($node->nodeValue, $textStyles, $paragraphStyles);
}
return null;
}
It's not a good bug fix but it's works very well for me.