_https://i.stack.imgur.com/W2We5.gif
<img src=\"file:b:/smile.gif\" align=\"middle\">"
_https://i.stack.imgur.com/VPHzw.gif
<img src=\"file:b:/smile.gif\">
Required:
_https://i.stack.imgur.com/WlMhG.gif
I need to align the image in the JEditorPane and the image should not affect the height of rows. If I use align=middle – the picture is not aligned and retained influence on the height of rows.
To a solution of similar problems in html I use:
<span style=\"background-image: url('file:b:/smile.gif') 50% 50% no-repeat\"> </span>
But this method does not work in JEditorPane. How can I solve this problem?
To align your Images to the Middle of the JEditorPane, you can use something like this :
Here the text-align property can do that trick for you. And about that thing that image should not affect the size of the row, I am not sure about your intentions on that, but if I understood you right then you can provide a fixed width and height to your images in the
<img>tag.Here I used this code, and tell me if you desire something else, other than what you find in this code. Wish I could help,
And here is the output image :
MoreOver use this
. I had removed the extra bottom space from the image for you.