Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to position table in Netscape without margins?

Posted on 2002-07-07
23
Medium Priority
?
179 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
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)

722 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