Forum Moderators: not2easy

Message Too Old, No Replies

Images resizing when loading

..when they are in <table>

         

NazaretH

2:32 pm on Apr 17, 2004 (gmt 0)

10+ Year Member



I am new to CSS, so my pages are mostly HTML pages with heavy use of tables. I need to load pictures which cannot be given HEIGHT and WIDTH attribute, because they load from DB and dimensions vary. Of course when loading them, browser would give them too much space, thus widening table and the whole site layout...

So, how do I make them load and not influence the layout? Any solutions with CSS for this?

tedster

5:27 pm on Apr 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



CSS itself will not handle your issue, but you can use server side scripting such as PHP to read the dimensions of an image and write them into the HTML you serve up. I'm sure the folks in our PHP Forum would be glad to help you out.

defanjos

5:37 pm on Apr 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Might not work in your case, but what I do is to have two extra fields in the db called ImageHeight and ImageWidth, then I call that info when serving the image.