Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / December 2007



Tip: Looking for answers? Try searching our database.

help! Fixed width table with an image in it is assuming the images     intrinsic width

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
satya.komatineni@gmail.com - 29 Dec 2007 18:21 GMT
I have struggling with this for 2 days. I searched far and wide in
google and msdn etc. No luck. Hope one of you may have seen this. I am
seeing this in ie6 and ie7

What I want
**************
1. A table with a single cell that is say 100px wide, laid out from
left to right.
2. I want to put an image in it and set its width to 100px as well

What I expect
******************
I see the image that is shrunk in width to 100px wide.

Instead I see
*******************
1. I do see the image shrunk to 100px
2. But I see the width of the "td" increased to 500px which is the
size of the actual image

Here is the source code for it
*************************************
<html>
<head>

<style>
#test {background:blue}
</style>

</head><body>
<p>before the table
<table id="testt"><tr><td id="test" width="100px">
<image width="100%" src="http://hiddenlakegardens.msu.edu/
seasonal_interests/fall/fall1.jpg">
</image>
</td></tr></table>
<p>after the table
</body></html>

Here is the URL you can use to see the blue background of the
stretched "td"

http://www.satyakomatineni.com/akc/display?url=DisplayNoteBodyURL&reportId=2400&
ownerUserId=satya


Does anyone know how to be able to say the width of an image to 100%
while restricting its size using a container above such as a "td". I
can fix this by fixing the image width, but then I have to deal with
margins etc.

Your help is much much appreciated.
Beauregard T. Shagnasty - 29 Dec 2007 20:36 GMT
> I have struggling with

Multi-Posting.  Don't do that. See responses to the same query in
alt.html

http://oakroadsystems.com/genl/unice.htm#xpost

Signature

  -bts
  -Friends don't let friends drive Vista

Ian Hobson - 29 Dec 2007 20:44 GMT
> I have struggling with this for 2 days. I searched far and wide in
> google and msdn etc. No luck. Hope one of you may have seen this. I am
> seeing this in ie6 and ie7

Your problems are two.

a) No doctype.

Without a doctype, IE is in quirks mode - and its does its own thing.

Add a html strict doctype and fix your html. (Transitional would work
but has other defects).

b) Invalid markup.

You have no closing </p>s, you put a table (a block) within a paragraph,
in in-line context, and then put an invalid <image> tag in the <td>,
There is no such tag a <image> - you need <img>.

Fix those and your problems will go away.

Regards

Ian
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.