to use in<img src’“ColA” style=“width: ColB; margin-left: ColC; margin-top: ColD” alt=“”>
My coding skills are pretty weak, so really appreciate any advice or snippets how to do this.
Thanks for any help
David
That table, is that a database table?
So I’m presuming you want to pull image data from the database table, then render the image to the page in HTML.
Is that correct?
I get the impression that the images have different dimensions and the hard-coded style parameters being passed position the image nicely on a particular page width.
I would be tempted to investigate the CSS statements to
create a parent container for the image
display the image full width and height inside the parent div
parent div to have:
a. set margin, padding and borders, inline-block
b. centralise dynamic div within parent width
c. center dynamic div vertically
Applying the above conditions will make the image responsive for all web pages sizes.
Hi John,
Thanks very much for this. Exactly the advice and snippets I was looking for.
I’m trying to build a website for my wife’s paintings - one painting / page - these range from miniatures to full size canvases.
I’ll work through this and let you know
Thanks very much