HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Special Problem here concerning Images and Tables
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
WebMonkey33609



Joined: 12 Jul 2004
Posts: 3
Location: CA

PostPosted: Mon Jul 12, 2004 10:59 am     Special Problem here concerning Images and Tables Reply with quote

Hi.....

Well to get right to it, my problem is kind of weird. For some reason whenever I have an image inside a table, it displays not only the image but a transparent strip right below the image as well. This doesn't really work for me as the page I'm making has to have several images flush together. I have tried everything I can think of....declaring the height of the Table, the image, turning off all the borders, and I'm just stumped. To only add to the confusion, the page views fine in Mozilla but just gets messed up in IE with the previously mentioned transparent Strips below the images. I'm wondering if there maybe some issue with IE that I just don't know about. Well any help any one could lend me would be greatly appreciated.

WebMonkey33609
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8260
Location: Castle Rock CO USA

PostPosted: Mon Jul 12, 2004 4:34 pm     Reply with quote



Welcome to the forums WebMonkey33609

Do you have some of the source code to help us see your problem a bit better?

Thanks!
WebMonkey33609



Joined: 12 Jul 2004
Posts: 3
Location: CA

PostPosted: Mon Jul 12, 2004 6:27 pm     Source Reply with quote

Here an example of what I'm doing...

Code:

<HTML>

   <HEAD>
   
      <TITLE>
         John's Website
      </TITLE>
         
   </HEAD>
   
   <BODY bgcolor="#5B5B5B">
   
   <CENTER>
   <TABLE bordercolor="black" cellpadding="0" cellspacing="0" border="1">
   
      <TR>
         <TD>
            <IMG src="john.gif" alt="My Name" />
         </TD>
      </TR>
      
   </TABLE>
   </CENTER>
   
   </BODY>
</HTML>


Basically I'm having trouble displaying an image inside a <TD>. When I put any image in there, IE adds on a little transparent strip at the bottom and what I'm trying to do is get the bottom of the image flush with the bottom of the border. I'm sure there is some command either with the <IMG> or the Table that can get rid of it, its just I don't have the slightest idea what that command might be. Thanks
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8260
Location: Castle Rock CO USA

PostPosted: Mon Jul 12, 2004 8:00 pm     Reply with quote

Try this:
Code:

<HTML>

   <HEAD>
   
      <TITLE>
         John's Website
      </TITLE>
         
   </HEAD>
   
   <BODY bgcolor="#5B5B5B">
   
   <CENTER>
   <TABLE bordercolor="black" cellpadding="0" cellspacing="0" border="1">
   
      <TR>
         <TD>
            <IMG src="john.gif" alt="My Name" /></TD>
      </TR>
       
   </TABLE>
   </CENTER>
   
   </BODY>
</HTML>
mjpliv



Joined: 11 May 2004
Posts: 406
Location: Nova Scotia

PostPosted: Tue Jul 13, 2004 4:56 am     Reply with quote

What's the extra slash "/" for in the image tag?
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8260
Location: Castle Rock CO USA

PostPosted: Tue Jul 13, 2004 5:08 am     Reply with quote

It is XHTML: http://www.w3schools.com/xhtml/xhtml_html.asp Smile
mjpliv



Joined: 11 May 2004
Posts: 406
Location: Nova Scotia

PostPosted: Tue Jul 13, 2004 5:21 am     Reply with quote

Corey, according to the page you referenced there should be an extra space between the tag contents and the "/" for it to work with some browsers. There is just a single space in the example posted here. That might be the problem.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8260
Location: Castle Rock CO USA

PostPosted: Tue Jul 13, 2004 5:25 am     Reply with quote

Not too sure if it was exactly that - I just noticed when I moved that TD up, it seemed to close the gap. I think though that he just gave me the very basic coding that he was having a problem with (hopefully) Wink
mjpliv



Joined: 11 May 2004
Posts: 406
Location: Nova Scotia

PostPosted: Tue Jul 13, 2004 9:38 am     Reply with quote

If I was a betting man then I would say that XHTML requires the "/" to simulate the closing of the tag. If the tag is not closed the it would appear that XHTML includes the white space as part of the document displayed by the browser. According to the XHTML tutorial some browsers won't recognize the "/" unless there are two spaces before it.

It would explain why it worked in on browser for WebMonkey33609 and not in another.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8260
Location: Castle Rock CO USA

PostPosted: Tue Jul 13, 2004 9:42 am     Reply with quote

Just something else for me to learn LOL
WebMonkey33609



Joined: 12 Jul 2004
Posts: 3
Location: CA

PostPosted: Tue Jul 13, 2004 6:36 pm     Tim-may! Reply with quote

ok...i feel like a retard now...TiM-MaY!....thanks for the help, the problem was that I was trying to make things to organized and when I had the </TD> command on the next line, it inserted that space there. Thanks for the help.

WebMonkey
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8260
Location: Castle Rock CO USA

PostPosted: Tue Jul 13, 2004 6:42 pm     Reply with quote

Glad to have helped Smile - it took me a few minutes. I am like that myself - like it all organized but I guess some browsers dislike organization Laughing
eXcentra



Joined: 12 May 2004
Posts: 91

PostPosted: Tue Jul 13, 2004 8:08 pm     Reply with quote

In XHTML, you're supposed to close the tag that the <img/> tag is in on the same line.
Example,
Code:

<div>
  <img src="pic.jpg"/></div>

<a href="page.htm">
  <img src="picture.jpg"/></a>

I was working on my site and I had this exact same problem except that I don't remember why the gap is created there. Someone explained to be but I don't remember.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial