I've been trying for some days to center an image horizontally inside a .docx file generated from HTML with docx4j without success. What I've tried so far (and works in HTML) is:
<div align="center"><img alt="" src="data:image/png;base64,/9j/4AAQSkZJ..."></div>
(by centering outer div)
<div><img alt="" src="data:image/png;base64,/9j/4AAQSkZJ..." clase="img-default"></div>
with the following commands inside Style tag:
.img-default {
margin: 0 auto;
display: block;
height: auto;
max-width: 100%;
}
The code I'm using to generate the .docx is available here, guided from this question. Thanks!