473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

unnecessary white space at bottom for netscape

Hi I have a very strange problem for my page. I have writen a js to make
sure my table's height is 100% for the browser's viewport. my code is just
the following. This works fine for firefox and IE. but in netscape, i found
there is some white space at the bottom of the page whose height is about
10- 20 pixal. and these white space cause the v-scrollbar appears. I have no
idea what is wrong here. Can any one help me on this one.

Cheers
Victor

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="padding:0;margin:0; ">
<form id="form1" runat="server">
<script type="text/javascript">
function getWindowHeight()
{
var windowHeight=0;
var minWindowHeight = 700;
if (typeof(window.innerHeight)=='number')
{
windowHeight = window.innerHeight;
}
else
{
if (document.documentElement&&
document.documentElement.clientHeight)
{
windowHeight = document.documentElement.clientHeight;
}
else
{
if (document.body&&document.body.clientHeight)
{
windowHeight = document.body.clientHeight;
}
}
}

if (windowHeight < minWindowHeight)
windowHeight = minWindowHeight;

return windowHeight;
}

function setHeight()
{
if (document.getElementById)
{
var windowHeight=getWindowHeight();

if (windowHeight 0)
{
var tblMain = document.getElementById("tblMain");
tblMain.style.height = windowHeight + 'px';
}
}
}

window.onload = function() {setHeight();}
window.onresize = function() {setHeight();}

</script>
<table id="tblMain" cellpadding="0" cellspacing="0" width="980px"
style="border:solid 1px red;">
<tr>
<td>
testing info
</td>
</tr>
</table>
</form>
</body>
</html>
Feb 28 '07 #1
2 1525
On Feb 28, 3:30 am, "Victor" <vic...@noemail.noemailwrote:
Hi I have a very strange problem for my page. I have writen a js to make
sure my table's height is 100% for the browser's viewport. my code is just
the following. This works fine for firefox and IE. but in netscape, i found
there is some white space at the bottom of the page whose height is about
10- 20 pixal. and these white space cause the v-scrollbar appears. I have no
idea what is wrong here. Can any one help me on this one.

Cheers
Victor

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="padding:0;margin:0; ">
<form id="form1" runat="server">
<script type="text/javascript">
function getWindowHeight()
{
var windowHeight=0;
var minWindowHeight = 700;
if (typeof(window.innerHeight)=='number')
{
windowHeight = window.innerHeight;
}
else
{
if (document.documentElement&&
document.documentElement.clientHeight)
{
windowHeight = document.documentElement.clientHeight;
}
else
{
if (document.body&&document.body.clientHeight)
{
windowHeight = document.body.clientHeight;
}
}
}

if (windowHeight < minWindowHeight)
windowHeight = minWindowHeight;

return windowHeight;
}

function setHeight()
{
if (document.getElementById)
{
var windowHeight=getWindowHeight();

if (windowHeight 0)
{
var tblMain = document.getElementById("tblMain");
tblMain.style.height = windowHeight + 'px';
}
}
}

window.onload = function() {setHeight();}
window.onresize = function() {setHeight();}

</script>
<table id="tblMain" cellpadding="0" cellspacing="0" width="980px"
style="border:solid 1px red;">
<tr>
<td>
testing info
</td>
</tr>
</table>
</form>
</body>
</html>
here's nothing related to ASP.NET

Netscape's window.innerWidth and window.innerHeight properties always
included the width/height of scrollbars
http://www.jibbering.com/2002/7/drunclear-measure.html

Feb 28 '07 #2
Hello Victor,

Regarding on the problem page, have you tried compare the client-side
rendered html source to see whether there is any different between the
netscape and other browsers? If not, I'm afraid the problem is likely due
to the netscape's particular rendering engine. Also, you can try manually
set all the margin(four margin css style attrributes) to see whether it
helps.

<body style="margin-bottom:0; margin-left:0; margin-right:0; margin-top:0">

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Stanimir Stamenkov | last post by:
Is it possible to make two inline elements to appear adjacent stripping any white space appearing in between in the source? Example: <span class="adj">1</span> <span class="adj">2</span>...
2
by: Jerry Sievers | last post by:
tried to avoid using PRE in the page markup and instead used DIV CLASS=foo and assigned the white-space pre property to it. have some reports already that text is not showing as preformatted. ...
5
by: Applebrown | last post by:
Hello, basically, I'm just learning intermediate CSS and trying to convert my old table webpage completely to CSS. Hoorah, right? Well, it's not quite going as planned. It's an extremely simple...
0
by: Mark Moore | last post by:
I'm trying to layout a couple text input fields and their corresponding labels without using a table. When I was trying to debug my understanding of CSS, I was *very* surprised to see that span's...
6
by: Tony T | last post by:
Can anyone help me with this - it may be obvious, but I just can't see it. I'm working with PC and WinME. In IE6, the two divs inside the wrapping div have no space between them, which is how I...
11
by: namenotgivenhere | last post by:
My design goal is to make the white space above and below <p> and <ul> equal to the height of my font. The first step to achieving this I believe is to have an equal amount of white space above or...
28
by: Alan Silver | last post by:
Hello, Here I am again with another "why does IE do that" question!! Please have a look at http://www.kidsinaction.org.uk/fd/homepage.html and see if you can work out why IE adds a one pixel...
4
by: Nathan Sokalski | last post by:
I have two asp:ImageMaps in a table cell as follows: <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="center"> <asp:ImageMap ID="mapBanner"...
3
by: amandadev | last post by:
Hi there, Please take a look at: bluecelery.amandadevries.com/index.html as well as the CSS and tell me why there is a white space in the table in Firefox (that looks like a white...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.