Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Set width and height in pixels and center image in cell #339

Open
tiagocostaHB opened this issue Apr 8, 2021 · 0 comments
Open

Set width and height in pixels and center image in cell #339

tiagocostaHB opened this issue Apr 8, 2021 · 0 comments

Comments

@tiagocostaHB
Copy link

Hi,

I've been trying to set the row height and the column width to the exact size in pixels of an image added to the cell, but I can't make it to fit, I've been trying with the examples given here (#182 (comment)), for example setting the column width with:

ws.column(ws.lastUsedCol).setWidth( Math.trunc(((imageSize.width - 11) / 7) * 100 + 0.5) / 100 );

where imageSize.width is the pixels width but still it doesn't fit perfectly the image width, how can I implement this?

Also, how can I center an image in a cell by using the position colOff and rowOff?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant