Solved

How to position table in Netscape without margins?

Posted on 2002-07-07
23
173 Views
Last Modified: 2010-04-09
I have been trying to put a table at the very top and left of my page. I can get this to look beautiful in IE 6
but Netscape 4.78 does not display the table at the absolute top and left. I've tried fixing this in html and even css (I'm a beginner css'er) with no luck. Any help would be greatly appreciated! Thanks, Emory.

<div align="left">
<table position:absolute; left:0; top:0; bgcolor="black" width="700">
  <tr>
    <td bgcolor="green">Test</td>
  </tr>
</table>
</div>
0
Comment
Question by:emory7
  • 8
  • 5
  • 5
  • +2
23 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7136110
Try this in the head of the page:

<style>
   body, div, table {margin:0px 0px 0px opx}
<style>

Cd&
0
 

Author Comment

by:emory7
ID: 7136362
That doesn't seem to have any effect on it. I also closed the last <style> tag. Thanks.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7136638
If you just put a table as the first thing in your page, it should show top and left....

otherwise, NS 4.x doesn't have very good support for positioning....


Where is the table in your code, and where is it showing up on the page?  Need more info on the problem

BRUNO
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:emory7
ID: 7136738
Yeah, the table is the first thing. Here's the latest code I've been working with, thanks:

<html>
<head>
<title>Test</title>

<body>

<table>
  <tr>
    <td bgcolor="green" width="700">Test</td>
  </tr>
</table>

</head>

</body>
</html>
0
 

Author Comment

by:emory7
ID: 7136742
Yeah, the table is the first thing. Here's the latest code I've been working with, thanks:

<html>
<head>
<title>Test</title>

<body>

<table>
  <tr>
    <td bgcolor="green" width="700">Test</td>
  </tr>
</table>

</head>

</body>
</html>
0
 
LVL 18

Expert Comment

by:bruno
ID: 7136781
and what problem are you experiencing with that?  just a slight margin at the top and left of the page?


this is not correct code going forward, but if you are coding for an older browser, this should work....


<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">


BRUNO
0
 

Author Comment

by:emory7
ID: 7136858
That does move the table almost flush with the left corner. However, in IE 6 it pushes it down somewhat. If I don't find a better solution, I'll accept that. Thanks very much. Emory
0
 
LVL 18

Accepted Solution

by:
bruno earned 200 total points
ID: 7136869
ok, here is your whole page...


<html>
<head>
<title>Test</title>

<style>
/* this removes the page margins */
body {
margin-left: 0px;
margin-top: 0px;

}
</style>

</head>  <!-- You left this tag out before as well -->

<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">

<table>
 <tr>
   <td bgcolor="green" width="700">Test</td>
 </tr>
</table>

</head>

</body>
</html>
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7136883
I wouldn't bother with the one in the style. The one with the body tag should do it.

Also make sure you don't have any extra space after the body tag but before the table. Don't put a div around it unless you give it a position of 0,0. Take the position out of the table tag, it doesn't belong there.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7136891
ww,

according to emery, the one in the body tag didn't fully do it in IE 6..


The one in the style will, and the one in the style is the correct way to do it going forward, as ALL those tags within the body tag are not correct within XHTML.



BRUNO
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7137285
<table style="position:absolute; left:0; top:0; border-spacing:0;border-collapse:collapse;margin:0;padding:0;" bgcolor="black" width="700">
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7137286
oops, didn't see the 4.78 in you question before sending.
My suggestion does not work for Netscape 4.x.
AFAIK there is no solution for Netscape 4.x at all.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7137590
Sure there is. Take out the div, take out the position in the table, set the marginheight/width in the body tag. Make sure there's no space, no gap, NOTHING between the body tag and the table. If you DO leave the div, make SURE you set the position on THAT.

Works for most 4.x versions of Netscape. Probably not all, but comes closest.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7137593
And I suspect that the reason it's not working in IE6 is the div tag... though I don't have it to check. The style SHOULD work for it, but again, I don't have it to check.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7137786
You guys are NOT paying attention.  

In the latest code that emory posted, there was NO div tag.

If the last code I posted doesn't work, nothing will.



BRUNO
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7138595
BRUNO's suggestion works for Netscape 4.x with following change:

<TABLE CELLPADDING="0" CELLSPACING="0">
0
 
LVL 18

Expert Comment

by:bruno
ID: 7138629
those should not affect the outside of the table.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7138667
In theory theory and praxis are the same, in praxis they are not. :-o
0
 
LVL 18

Expert Comment

by:bruno
ID: 7138680
*L*
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7138995
Good catch... Netscape will put in both cellpadding and cellspacing unless told otherwise, and if you don't have a border on, it will look like the space is around the table rather than inside it. ;-)

And make sure there's no space after the body tag... I've been burned by that one before. The table tag can start on the next line, but no extra blank lines.
0
 

Author Comment

by:emory7
ID: 7139660
Thanks to all of you for your help! I really appreciate it. Bruno gets the cigar with WW and ahoffman honorable mention.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7139665
:-)  Thanks emory, glad we could help you!
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7140113
> And make sure there's no space after the body tag...
hmm, that's not necessary on UNIX/Linux, probably on M$ systems.

BTW, I have the feeling that cellspacing and cellpadding in Netscape 4.x (and even 6.x, 7.x) also behaves like CSS' border-collapse and border-spacing. Unfortunately I never found docs about the rendering algorithm for 4.x browsers.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS: Making responsive table look nicer 7 31
Multiflying 2 Input Text On a Table 7 31
key press alert 2 32
Load data upon clicking a button 8 35
This article discusses four methods for overlaying images in a container on a web page
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question