Solved

How to position table in Netscape without margins?

Posted on 2002-07-07
23
176 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

634 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