Forum


Replies: 1   Views: 543
Addimage on top left corner of table cell
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 Exorion  · 21-05-2021 - 10:09

Hi guys!

I have a table with text, and i want to add image to a left corner of table, but if i make a float left i put it only after the spacing of table cell. For example if i have a spacing in td for 5 pixels, my image align to left position with 5 pixel in top left, but i need it to be 0 or even -5px.

Is it possible? Thanks in advance

Posted by admin  · 21-05-2021 - 10:24

Hello,

We recommend you to remove that spacing in the cell to be able and also use the following options available in addImage:

* 'relativeToHorizontal' (string) margin (default), page, column, character, leftMargin, rightMargin, insideMargin, outsideMargin. Not compatible with inline text wrapping

* 'relativeToVertical' (string) margin, page, line (default), paragraph, topMargin, bottomMargin, insideMargin, outsideMargin. Not compatible with inline text wrapping

As this is a very specific question, we'd need to check how you are creating the table or the template you are using. For this case, we recommend you to open a support ticket (https://www.phpdocx.com/support) with a template and code sample and the dev team will check them and generate a custom code to illustrate how to accomplish it.

Regards.