Div not hiding in IE 6 or Firefox

B

brian.newman

<div id="otherBaseData" style="display:none; margin-left:20px">
<tr>
<td> Type in Location </td>
<td><input type="text" name="projected_base" maxlength="50"></td>
<td></td>
<tr>
</div>

I'd like for the above to not be visible when the page loads, so,
later, I can change it using javascript to be shown. I haven't written
the javascript to reveal this block. I wanted to test it as is first.
It shows when the page loads. I have no idea why. I've tested it in
both IE 6 and Firefox and they both act the same way.
What am I doing wrong here?
 
E

Els

<div id="otherBaseData" style="display:none; margin-left:20px">
<tr>
<td> Type in Location </td>
<td><input type="text" name="projected_base" maxlength="50"></td>
<td></td>
<tr>
</div>
[...]

What am I doing wrong here?

Putting a div between <table> and <tr>. You can't put anything (other
than <tbody> and <thead>) between table elements.
 
B

Beauregard T. Shagnasty

<div id="otherBaseData" style="display:none; margin-left:20px">
<tr>
<td> Type in Location </td>
<td><input type="text" name="projected_base" maxlength="50"></td>
<td></td>
<tr>
</div>

I'd like for the above to not be visible when the page loads, so,
later, I can change it using javascript to be shown. I haven't written
the javascript to reveal this block. I wanted to test it as is first.
It shows when the page loads. I have no idea why. I've tested it in
both IE 6 and Firefox and they both act the same way.
What am I doing wrong here?

What happens if you move the styling to the style sheed under the id, or
remove the id from the tag? URL to your page?

What happens when you want to display it in a browser where JavaScript
is disabled or stripped by a firewall?
 
J

Jonathan N. Little

<div id="otherBaseData" style="display:none; margin-left:20px">
<tr>
<td> Type in Location </td>
<td><input type="text" name="projected_base" maxlength="50"></td>
<td></td>
<tr>
</div>

I'd like for the above to not be visible when the page loads, so,
later, I can change it using javascript to be shown. I haven't written
the javascript to reveal this block. I wanted to test it as is first.
It shows when the page loads. I have no idea why. I've tested it in
both IE 6 and Firefox and they both act the same way.
What am I doing wrong here?
Cannot put a DIV between TABLE and TR elements! But you could style the
TR directly

<table>
....
<tr id="otherBaseData" style="display:none;">
<td> Type in Location </td>
<td><input type="text" name="projected_base" maxlength="50"></td>
<td></td>
<tr>
....
</table>
 
B

brian.newman

Okay, so I'm confused.
I tried
<tr>
<div id="otherBaseData" style="display:none; margin-left:20px">
<td> Type in Location </td>
<td><input type="text" name="projected_base" maxlength="50"></td>
<td></td>
</div>
</tr>
and that doesn't work either. I guess that's because there can't be
anything between <tr> and <td>, but, if that's the case, then how does
is this kind of thing done?
 
E

Els

Okay, so I'm confused.
I tried
<tr>
<div id="otherBaseData" style="display:none; margin-left:20px">
<td> Type in Location </td>
<td><input type="text" name="projected_base" maxlength="50"></td>
<td></td>
</div>
</tr>
and that doesn't work either. I guess that's because there can't be
anything between <tr> and <td>, but, if that's the case, then how does
is this kind of thing done?

<tr id="otherBaseData" style="display:none;">
<td> Type in Location </td>
<td><input type="text" name="projected_base" maxlength="50"></td>
<td></td>
</tr>

Maybe? Not tried, and since I have no idea what you wanted the 20px
margin-left for, I left it out. AFAIK you can't set a margin on a tr
or td. Some browsers honour a padding on <table> though.
 
B

brian.newman

Putting the display attribute into the <tr> tag seems to have done the
trick!
Thanks guys
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top