0

I have a question in PhpWord i'm trying to add image to word using Html code, but this is doesn't work. I used visual studio code and the image is on the folder public. Thanks you to help me.

$html = '<table>
  <tr>
    <th>Header</th>
    <td>Content</td>
    <td> <img src'.public_path().'/phone.jpg></td>
  </tr>
</table>';

\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html);

1 Answer 1

1

Asked almost a month ago, you've probably figured this out already? Looks like your 'src' attribute is missing an "=" after it. Also, pretty sure html insists on the attribute value being inside quotation marks, even though this would be allowed in css - that might throw phpword off, not sure.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.