By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,583 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,583 IT Pros & Developers. It's quick & easy.

Why is Netscape 6.1 disappearing my final table row?

P: n/a
I apologize for the length of the page below, but I've tried
to whittle it down as much as I can. The problem is that
Netscape 6.1 on my Win 2K Pro machine is disappearing
the final row of the table.

Opera 7.01 and IE 5 and 5.5 are both OK with the page, and
the offending line is right before the commented out alert line,
but I have been unable to figure why it's happening.

Thanks,
Csaba Gabor from New York

PS. While I am happy to have suggestions on ways to
improve the page (which I will eventually broach separately),
I am primarily intersted in understanding what is going on.

For those who are interested in making suggestions,
The intent of the page is to have the visible area of the
SCREEN filled with a TEXTAREA (to the extent possible)
while accomodating 5 uniformly sized buttons (each with
underlined accessKey. My code will do the uniform sizing)
to its right, with a line below the table and a few above. There
will be more stuff on the page below this, but I want the user
(me) to be able to see the entire TEXTAREA element
without scrolling.
This sounds pretty straightforward, but I've had lots of
problems getting agreement between Opera / IE / Netscape,
which is why you may see lamentable constructions like 4.5in.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD>
<META http-equiv="content-type" content="text/html;charset=iso-8859-1">
<TITLE>Netscape demo</TITLE>
<STYLE type="text/css">
<!--
table#mytab td, table#mytab th {
border: 1px solid #000000; font-size: 75%; vertical-align:top;}
-->
</STYLE>
<SCRIPT type="text/javascript">
function uniformWidths(aButtons) {
// aButtons is either an array of buttons or a list of them.
// Makes them all the width of the widest one
var butt, i, myDiv, max = 0;
if (arguments.length>1) {
aButtons = [aButtons];
for (i=1;i<arguments.length;i++) aButtons[i] = arguments[i]; }
for (butt in aButtons)
if (aButtons[butt] && aButtons[butt].offsetWidth > max)
max = aButtons[butt].offsetWidth;
for (butt in aButtons) {
myDiv = aButtons[butt].getElementsByTagName("DIV")[0]
myDiv.style.width = max;
//alert(max + "\r\n" + aButtons[butt].innerHTML);
aButtons[butt].style.posWidth = max;
}
}
function allButtonsUniform (frm) {
var elem, aButts = [];
for (var i=0;i<frm.elements.length;i++) {
elem = frm.elements[i];
if (elem.type=="button") aButts[aButts.length] = elem; }
if (aButts.length>1) uniformWidths(aButts);
}
</SCRIPT>
</HEAD>
<BODY style="height:100%;padding:0;margin:0;border:solid 1px red"
onLoad='allButtonsUniform(document.forms[0])'>
<DIV style="height:95%;margin-left:.2in;border:solid 1px blue">
<BR><CENTER>Title goes here</CENTER><BR>
<FORM method=post action='index.php' name='Up'>
<TABLE id=mytab style='width:98%;border:solid 1px green'>
<TR>
<TD>Placeholder</td>
<TD align=right>Authorization:</TD>
<TD style='width:4%'><INPUT type=password size=24 name=jelszo></TD>
</TR><TR>
<TD rowspan=2 colspan=2><TEXTAREA
rows=36 cols=10 name=code style='width:100%'></TEXTAREA></TD>
<TD><BUTTON type=button><DIV>PHP / Script</DIV></BUTTON></TD>
</TR><TR>
<TD style='height:4.5in'><BUTTON type=button><DIV
Upload</DIV></BUTTON></TD>

</TR><TR>
<TD>This is</TD>
<TD>the last</TD>
<TD>row</TD>
</TR>
</TABLE>
</FORM></DIV></BODY></HTML>

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Is this more of a js question? Or css? You ought to pick one. Or at
least set followups. [I can't tell from the code posted, so I've
opted not to set them for the op.]

Csaba2000 wrote:
I apologize for the length of the page below, but I've tried
to whittle it down as much as I can.
Instead of posting code, how about uploading the html file somewhere
for us to test?
table#mytab td, table#mytab th {
border: 1px solid #000000; font-size: 75%; vertical-align:top;}


See the recent thread "my messy stylesheet just ain't..." for what's
wrong with your font-size declaration.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2

P: n/a
"Brian" <us*****@mangymutt.com.invalid-remove-this-part> wrote in message news:QINfb.679768$YN5.539190@sccrnsc01...
Is this more of a js question? Or css? You ought to pick one. Or at
least set followups. [I can't tell from the code posted, so I've
opted not to set them for the op.]

I'm sure I don't know. Otherwise, I wouldn't have cross posted
to both groups. It's clearly not a pure css issue since javascript
is required to show the problem. On the other hand, the offending
line involves .style (and, not being a css expert, to my mind css
and .style are pretty intertwined) and has more of a css type of
feel to me. I've never set followups, but from everything I've read,
if the responses don't appear in all the original groups, people
(including me) get annoyed because they don't see answers.
Although perhaps I misunderstand what you mean since I
haven't dealt with setting followups.
Csaba2000 wrote:
I apologize for the length of the page below, but I've tried
to whittle it down as much as I can.
Instead of posting code, how about uploading the html file somewhere
for us to test?


I often do both, but I almost always post the code. I do that for my
own benefit, because the web makes a great filing cabinet. To the
extent that others may see my work, too, and that I may forget the
details, I usually spend an hour or two carefully composing the example
to be minimal and illustrate the salient points in case I come back to
it much later.

Because of the length, I would normally provide a link, but I will be
moving within two days, and my server will be defunct for an
extended period till I am resettled. I prefer to minimize the amount
of mutterings about broken web links, especially considering that
the most amount of hits would come in the next several days.
table#mytab td, table#mytab th {
border: 1px solid #000000; font-size: 75%; vertical-align:top;}


Oops. My bad. I was doing some experimentation and forgot
to take that out.

Csaba
See the recent thread "my messy stylesheet just ain't..." for what's
wrong with your font-size declaration.

--
Brian
follow the directions in my address to email me


Jul 20 '05 #3

P: n/a
Yep
"Csaba2000" <ne**@CsabaGabor.com> wrote in message news:<bl********@dispatch.concentric.net>...
I apologize for the length of the page below, but I've tried
to whittle it down as much as I can.
60 lines isn't a long script, that's perfectly acceptable in a regular
post (beyond ~300 lines I believe that a link is better).
Netscape 6.1 on my Win 2K Pro machine is disappearing
the final row of the table.
I don't have NN6.1 here so cannot reproduce the problem (nor represent
it I'm afraid), but give a look at the following suggestions...
for (butt in aButtons)
You've got an array eventually, so you'd better use a normal iterator
rather than the for..in construction.
myDiv.style.width = max;
Incorrect here, "max" is filled with a double, while you need a string
and the appropriate css postfix:
myDiv.style.width = max + "px"
(and IIRC NN6.1 was affected by this)
<BODY style="height:100%;padding:0;margin:0;border:solid 1px red"
onLoad='allButtonsUniform(document.forms[0])'>


Better to use a CSS block declarations rather than inline declarations
IMHO, you'd gain in readibility.

As for your TEXTAREA sizing issue, I'm not sure of what the best
solution could be, maybe resize it according to the screen height and
its relative position, something like the following gives usable
results on IE6, Mozilla1.3 and Opera 7 (provided I've understood your
issue correctly), less the pre-load temp sizing (very important for
non-supporting UAs; the load delay might be a pain too).
<style type="text/css">html,body{margin:0;padding:0}</style>
<textarea id="foo"></textarea>
<script type="text/javascript">
function getPageHeight(w) {
var d=(w||(w=window)).document;
if(typeof w.innerHeight=="number") return w.innerHeight;
else if(d.documentElement && d.documentElement.clientHeight &&
d.compatMode && d.compatMode=="CSS1Compat")
return d.documentElement.clientHeight;
else if(d.body && d.body.clientHeight) return d.body.clientHeight;
return 0;
}

function getYPos(elem) {
var y=0;
if (typeof elem.offsetTop=="number")
do y += elem.offsetTop;
while (elem = elem.offsetParent);
return y;
}

window.onload = function (evt) {
if(document.getElementById) {
var ta = document.getElementById("foo"),
taTop = getYPos(ta),
winHeight = getPageHeight();
ta.style.height = (winHeight - taTop) + "px";
}
}
</script>
Regards,
Yep.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.