jmcnamara / XlsxWriter

A Python module for creating Excel XLSX files.
https://xlsxwriter.readthedocs.io
BSD 2-Clause "Simplified" License
3.65k stars 633 forks source link

question: Center an image in merged cell #1068

Closed hungtrieu07 closed 5 months ago

hungtrieu07 commented 5 months ago

Question

Hi, I need to center an image in merged cell, but I search all on Google, nothing found. Is there anyway to do this? image This is my image in current Excel file.

jmcnamara commented 5 months ago

Unfortunately there is no easy way to do that. You will need to work out the pixel width and height of the image and calculate an offset in the merged cells to center it.

hungtrieu07 commented 5 months ago

Oh, I found a way to do that with image offset. Thanks for your reply.