Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to position table in Netscape without margins?

Posted on 2002-07-07
23
Medium Priority
?
182 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 800 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

885 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