Open Azamat8405 opened 3 days ago
When I try parse table from HTML by addHTML method I get error:
"Unsupported operand types: string \/ int", "../phpoffice\/phpword\/src\/PhpWord\/Shared\/Converter.php": 162
<div style="font-size:17px;"> <figure class="table" style="width:700px;"> <table style="border:10px #4c4ce5 ridge;" width="700"> <tbody> <tr> <td style="background-color:#e5e54c;width:100px;"></td> <td style="width:400px;">v</td> <td style="width:200px;">v</td> </tr> <tr> <td width="100px">v</td> <td style="background-color:#4ce5e5;" width="400px"></td> <td width="200px">v</td> </tr> </tbody> </table> </figure> </div>
There should be no mistake
$phpWordInstance = new PhpWord(); $phpSectionInstance = $phpWordInstance->addSection([ 'orientation' => 'landscape', 'marginLeft' => (int)round(20 * 56.6929133858), 'marginRight' => (int)round(20 * 56.6929133858), 'marginTop' => (int)round(20 * 56.6929133858), 'marginBottom' => (int)round(20 * 56.6929133858), ]); $html = '<div style="font-size:17px;"> <figure class="table" style="width:700px;"> <table style="border:10px #4c4ce5 ridge;" width="700"> <tbody> <tr> <td style="background-color:#e5e54c;width:100px;"></td> <td style="width:400px;">v</td> <td style="width:200px;">v</td> </tr> <tr> <td width="100px">v</td> <td style="background-color:#4ce5e5;" width="400px"></td> <td width="200px">v</td> </tr> </tbody> </table> </figure> </div>'; Html::addHtml($phpSectionInstance, $html, false, false); $fqName = new PhpOffice\PhpWord\Writer\Word2007($phpWordInstance); $fqName->save('./t.docx');
1.3
8
Describe the bug and add attachments
When I try parse table from HTML by addHTML method I get error:
Expected behavior
There should be no mistake
Steps to reproduce
PHPWord version(s) where the bug happened
1.3
PHP version(s) where the bug happened
8
Priority