Tiny space under images in table

liunx

Guest
I have an image in a table but there always seems to be a tiny space underneath it. This is important for me because I need to line up the images in 2 rows in a table, and the space messes it up. <br />
<br />
You can see it here:<br />
<br />
<!-- m --><a class="postlink" href="http://www.geocities.com/jusl89/">http://www.geocities.com/jusl89/</a><!-- m --><br />
<br />
I've put borders around the tables so you can see how I broke it down. PLease help.<!--content-->To sort your problem out you will need to add some varibles to the <td> tag. Something along the lines of:<br />
<br />
<td valign="top" width="***" height="***"><br />
<img src=http://www.htmlforums.com/archive/index.php/"sideleft.gif"><br />
</td><br />
<br />
where *** is the width and height of the image in pixels.<br />
<br />
<hint>It is not advisable to code your tags in uppercase. There are many reasons for this, but mainly because W3 recommends that HTML 4.01 should all be written in lower case. </hint><br />
<br />
Hope that works for you, like what you are doing in terms of colour and layout.<!--content-->I did the pixel dimensions in the <td> tag but it still didn't work. KNow anything else?<br />
<br />
And thanks for the opinion!<!--content-->put the closing td on the same line as your image...<br />
<br />
your code:<br />
<br />
<td valign="top" height="13" width="159"><br />
<img src=http://www.htmlforums.com/archive/index.php/"sideleft.gif"><br />
</td><br />
<br />
<br />
new code:<br />
<br />
<td valign="top" height="13" width="159"><br />
<img src=http://www.htmlforums.com/archive/index.php/"sideleft.gif"></td><!--content-->oh and i also wouldnt get into the habbit of passing a height attribute to the td...it will just end up wasting your time. if you must use it i would stick it on the image and let the table detail sort itself out.<!--content-->Setting table sizes in pixels gives you a very good method of definate size. However, contary to popular belief it is not 100% exact. For example by setting a border value of 1 or above can affect your width and height by a pixel or 2.<br />
<br />
So the first thing I suggest you do is remove the border value to see if the width and hight settings give you a seamless table design.<br />
<br />
Also try setting the horizontal alignment in the td tag. The alignment should be left by default but add the tag to see. <td align="left" etc etc>.<br />
<br />
Another problem you have is whitespace. Before the <img src=http://www.htmlforums.com/archive/index.php/"sideleft.gif"> tag you have 12 spaces, any browser will recognise the first of the white spaces as valid inclusion into the web doc. Try to rectify this by changing the code as follows.<br />
<br />
<td valign="top" height="13" width="159"><img src=http://www.htmlforums.com/archive/index.php/"sideleft.gif"></td><br />
<br />
It is the same as your but with no carriage returns or spaces. To be honest, I think this is your problem.<!--content-->You got there just before me... oh well.<!--content-->I disagree with alkaline. Letting the img tag take care of the height is good if your browser is set up to Download <!--more--> images. Many people use text browsers and have images turned off. <br />
<br />
Thus your overall page layout could get all skewed if you don't sort this out at the table <td> level.<!--content-->sometimes i forget about those 0.005% of users who dont Download <!--more--> images...or is it i just dont care about them...either way...i waste enough time supporting netscape let alone tweaking out tr and td heights. makes site changes a real pain in the... :)<br />
<br />
on the text browser side though...if people do hit your site with lynx its a good idea to include alt attributes on your image tags...also does a lot of good with spiders.<!--content-->Your quite simply not upto scratch then are you!<br />
I would suggest that a good portion of surfers don't surf with images on. Would you design a new car without a cig lighter because you don't smoke? No you wouldn't as a cig lighter serves other useful purposes.<br />
<br />
So why design a site for browsers that don't wish to view images intially, less than 0.05% surfs at asdl or better, and I would argue that most of the world (meaning not only the west) view at 25kbs. It isn't exactly hard to lay your tables out correctly and only seems like you are lazy.<!--content-->not up to scratch? i think not friend.<br />
<br />
people who browse without images are obviously use to looking at crap. the majority of developers dont specify heights in td. i would love to see some data on such usage. i know viewing my logs i never see people come in with images off.<br />
<br />
and it is hard calculating td heights if your doing anything but basic layout. if you are really anal about it all i guess after you have a finished design you could go back in and add heights..that would be the easiest. as far as me being lazy...i dont think so...i would be more than happy to share my portfolio with you. its called smart coding...i dont see the need to try and comply with every imaginable client / client configuration. maybe i could if i only had a single small site to work with...but those days are long gone.<!--content-->I hardly think table design is anal in terms of setting it up correctly especially if you are attempting a seamless layout. We shall have to differ on opinions here.<br />
<br />
I agree to disagree.<!--content-->ok you too break it up. :) this is the way to do it.<br />
<br />
all images should have width, heights, and alt attrib according to W3C standards. you can put them in the table cell tag which is also recommended but in some browsers doesn't do anything. now the reason people surf with images off is because they are on a slow connection like a modem. not everybody can get high speed access. now it doesn't matter what browser you use the alt attrib will show up if images are turned off. and in the stats pages you can't tell if they have images off or not so that is irrelevant.<!--content-->we're just havin a friendly discussion :) :)<br />
<br />
intersting article on slashdot that kinda pertains to this thread...<br />
<br />
<!-- m --><a class="postlink" href="http://slashdot.org/articles/02/07/08/1313246.shtml?tid=109">http://slashdot.org/articles/02/07/08/1 ... ml?tid=109</a><!-- m --><!--content-->that is all meaningless talk. everybody is intitled to there opinion. I don't code for lynx for 1 reason. I have had 2 hits in the last 7 months. so I don't code for it.<!--content-->It's all fun and good banter... but I am right :D <br />
<br />
Well at least 50% of the time.<!--content-->It's a pain in the @$$ recoding your site to accomodate different browsers - I know most people would rather make a great site that appears correctly in the browser most people use than 1) make different versions for different browsers or 2) make one version that works in every browser that doesnt meet your initial goals and ideas<!--content-->Just what has sizeing your frames properly got to do with righting for different browsers?<br />
<br />
Anyway lookout as the new mozilla is gonna kick ass out of explorer. Tho that doesn't mean people will use it. D'oh - it is a strange world. You offer the masses free Ferraris and they drive Ford Fiestas.<!--content-->
 
Back
Top