473,386 Members | 1,810 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,386 software developers and data experts.

Table row does not align correctly in Mozilla when hidden and displayed

shane3341436
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <form name="f1">
  10. <table width="1123">
  11.   <!--DWLayoutTable-->
  12. <tr>
  13.  
  14. <td width="160" height="22" valign="middle" class="small_font_grey"> <input type="radio" name="f1" value=0 onclick="selectf2(this.form)"  />
  15.   Hide            </td>
  16. <td width="360" valign="middle" class="small_font_grey"> <input type="radio" name="f1" value=1 onclick="selectf2(this.form)"  /> 
  17.   Show             </td>
  18. <td width="582">&nbsp;</td>
  19. </tr>
  20. <tr  align="center" >
  21.             <td  height="32" align="right" valign="middle" class="td_data_black">Field 1  :&nbsp; </td>
  22.             <td align="left" valign="top"  >
  23.               <input name="f3" type="text" id="f3"   />
  24.             Example 1</td>
  25.             <td  >&nbsp;</td>
  26.     </tr>
  27.  <tr id='divf2' align="center" style="display:none">
  28.             <td  height="32" align="right" valign="middle" class="td_data_black">Field 2  :&nbsp; </td>
  29.             <td align="left" valign="top"  >
  30.               <input name="f2" type="text" id="f2"   />
  31.             Example 2</td>
  32.             <td  >&nbsp;</td>
  33.  </tr>
  34.   </table>
  35. </form>
  36. </body>
  37. </html>
  38. <script>
  39.  
  40. function selectf2(form){
  41.  
  42.         if(form.f1[1].checked==true){
  43.             document.getElementById("divf2").style.display="block";
  44.  
  45.  
  46.         }
  47.         else if(form.f1[0].checked==true){
  48.             document.getElementById("divf2").style.display="none";
  49.  
  50.         }
  51. }
  52. </script>
It runs well on IE7 but not in mozilla. When rendered in mozilla the section which I want to hide and display do not align to same line as that of the upper section. When clicking on view source on mozilla browser the html tags are pretty good. I don't think there are any error. But still creating trouble in mozilla. Plz somebody help me to solve this problem.
Sep 19 '07 #1
6 3524
I used these codes for hiding and displaying an input field using the style property of 'tr' tag.
Sep 19 '07 #2
acoder
16,027 Expert Mod 8TB
Changed the thread title to better describe the problem.

For some reason, the table row is being squashed into one table cell space. I'll have to investigate this further.
Sep 19 '07 #3
Thanks for ur concern. Waiting for reply
Sep 21 '07 #4
acoder
16,027 Expert Mod 8TB
Thanks for ur concern. Waiting for reply
See this link. Firefox needs the display property to be set to "table-row", but since that wouldn't work in IE, use display set to "".
Sep 21 '07 #5
Thanx for ur help. It really does works.
Sep 27 '07 #6
acoder
16,027 Expert Mod 8TB
Glad to hear you got it working. Post again if you have any more questions.
Sep 27 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
1
by: Chris McGarry | last post by:
Hello, I'm new to style sheets and have been fighting with browser compatibility for two days. I'm developing a image selection page (similar to Ebay where the visitor can select and enlarge 1-6...
3
by: N. Demos | last post by:
I have a single row table with fixed dimensioned cells nested inside a fixed dimensioned div, which has overflow: hidden. The div's dimensions are such that It should only display the first two...
0
by: javaguy | last post by:
I have a table I hide show/hide through a pair of divs. The show/hide part works fine in both Mozilla and MSIE. When switching between the hide and show versions the Mozilla browser keeps them in...
1
by: cotton_gear | last post by:
Hello, Fiest of all let me thank this group for so quick in responding to any postings. I am using a javascript based utility from a site to sort the columns of the table. But, for some strange...
1
by: James Black | last post by:
I am dynamically generating a table in IE to display some information. I will probably change it to divs later, but I just want to get it working properly first. In my div I have the following...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
1
by: smilecry | last post by:
I am trying to create a tree table (javascript code was adopted from online source) but the rowspan in td tag does not work well when I toggle the rows. Here is the sample code, notice the row "4"...
2
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.