View Full Version : Force table cell height in Netscape
aslefo
05-26-2001, 07:26 PM
How can I remove the open space which Netscape 6 adds under a picture in table cells? (have set cell spacing and padding to zero)
Does Netscape ignore the height variable in td tags?
It appears fine in Explorer 5 and Opera 5.
Hi, please post your URL so we can view your problem please.
kevin
05-27-2001, 12:06 AM
If you find out let me know, I have run into this same problem and gave up. I have even tried using a style sheet to no avail (works in IE):
<style type="text/css">
td {padding-bottom: 0px}
</style>
Netscape does add one or two blank pixels below an image in a table cell regardless of how you code the page. Very annoying!
Regards,
Kevin
aslefo
05-27-2001, 10:23 AM
This simple code shows my problem
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR>
<TD HEIGHT="30"><IMG SRC="Image.gif" WIDTH="150" HEIGHT="30">
</TD>
</TR>
<TR>
<TD BGCOLOR="#FF0000" HEIGHT="30">-</TD>
</TR>
</TABLE>
(replace image.gif with and actual image and you will see)
Have tried resolving it in styles with no result
Hi, I just copied and pasted your above code and replaced the image and viewed it in IE5.5, NS4+ and NS6 and it is the same in all (no space below the image). Is it possible something else is effecting this?
aslefo
05-27-2001, 12:08 PM
hear this:
I use Hotmetal 6. It adds the following line to my html.
<!DOCTYPE HTML PUBLIC "-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//EN" "hmpro6.dtd">
When removing it, the white space disappears.
Truly weird.
Kevin, could this be the reason for your problems too?
kevin
05-27-2001, 01:29 PM
I removed the DOCTYPE
( <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Final//EN"> ) line and the gap below the image disappeared! I certainly never would have thought to try that! And it probably explains why Ian did not see this effect because his test code probably did not include a DOC TYPE line.
Try it with the DOCTYPE line Ian and see what happens....
Kevin
JohnM
05-27-2001, 01:35 PM
That is very wierd.
aslefo
05-27-2001, 02:03 PM
Does anyone know what the point of the line is anyway?
Is it just for the web editor, or does the browser use it?
Syst3m Err0r
05-27-2001, 04:49 PM
Maybe this is the solution:
Place a transparent gif 1px wide 30px tall into the cell...
Syst3m Err0r
05-27-2001, 04:55 PM
or if you have to space more cells use a transp. gif 5x5px and place them in you cells like:
<img scr="../images/5x5.gif" height="XX" width="XX">
replace the XX by the width/height that you want... this way you'll need only one picture to space the cells instead of making all kinds of different pictures for each cell.
aslefo
05-27-2001, 05:04 PM
Well actually, removing the doctype solved the problem. But thanks anyway.
kevin
05-27-2001, 07:26 PM
I believe the DOCTYPE declaration (DTD) in HTML pages is mainly to assist HTML validators when validating HTML code.
It is not necessary to declare a DTD although HTML standards say that it should be the first line of code in an HTML document.
The DTD is actually not part of HTML at all, it is part of SGML standard (Standard Generalized Markup Language) which is part of TEI (Text Encoding Initiative). This all has something to do with the setting of guidelines for the encoding of textual materials in electronic form, which is about all I know.
Why the DOCTYPE declaration line causes Netscape to display an HTML page differently when the line is included, I have know idea.
Regards,
Kevin
kevin
05-27-2001, 08:37 PM
Another interesting tid-bit...
If I change the DTD
from:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
to:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
the gap below images in table cells disappears.
Kevin
This is the DOCType I use in my pages Kevin,
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
it seems that word FINAL is causing some effect on page display.
kevin
05-27-2001, 10:45 PM
Yes, you are correct Ian, 4.0 Final is the one causing the problem. A bug in Netscape?
aslefo
05-28-2001, 06:42 AM
When I use your doctype, Ian, HotMetal won't accept the IMG NAME and HR COLOR tags.
Looks like the W3C doctype declaration doesn't support these tags. Have you had any problems with unsupported tags?
The HTML 3.2 doctype, however, gives me no trouble.
Nope, I haven't experienced any problems that have been the result of the doctype before. how about putting an example online and posting the url, I'd be interested to see what else is on your page.
Thanks.
BTW, is this only a NS6 problem?
aslefo
05-28-2001, 02:17 PM
Well actually, it's not a browser problem.
It's just that my html-editor won't accept certain tags when I use the W3C-doctype.
Think I'll just stop using doctypes, what's the point of it anyway.
The pages appear nicely without it.
have put up a draft on
http://www.ks-tambartun.no/kurs/01-02/brukerkurs.html
kevin
05-28-2001, 02:25 PM
Hi aselfo,
Its like I said in my previous post, the DOCTYPE declaration is mostly for HTML validation, which your editor is doing. Its validating that the code you are using is compliant with the DTD its specifying, if not, it will not allow it. I would think there must be away to tell HotMetal to ignore the validation or the DTD.....
Regards,
Kevin
aslefo
05-28-2001, 02:31 PM
I've tried lots of things, but HotMetal even makes changes on the doctypes I define myself.
I think it may be possible to define tags for each doctype, but wat a job it would be..
I haven't yet found a function to turn off the validation of doctype. Sure, it's possible to stop all validations, but I want it to correct false html.
Guess i'll find out after some puzzling... or asking the producer.
Ian: yes, this does not happen in navigator 4.08
stick35
03-28-2009, 09:58 PM
I know I'm jumping in here 8 years after the last post in this thread, but I wanted to post what I have found as an answer to this problem. I had the same gap problem under an image in a cell.
What I found was that removing the line-feed after the image (before the /td) it made my gap go away.
Notice in the code that was shown above, the /td was on the line following the img tag. Just move the /td up right after the img tag and the gap goes away.
coothead
03-29-2009, 06:11 AM
Hi there stick35,
and a warm welcome to these forums. :agree:
Eight years have elapsed since this thread was started and your suggested solution has since then become common knowledge. :agree:
It may not, of course, necessarily be the the best course of action to take. ;)
Furthermore, it may not be generally known what is the reason for the mysterious gap. :disagree:
I usually provide elucidation with this...
Eric A. Meyer article (http://devedge-temp.mozilla.org/viewsource/2002/img-table/)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.