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

IE not showing a table inside a div

Hi,
I'm constructing some HTML elements dynamically using javascript, the result looks fine in Firefox but IE 6 refuses to show some tables I've got inside Divs.

My code is a bit big so I'll only post the bit in question. Indentation is just for keeping track of where each tag is.

Why does IE behave this way?

Cheers,
Jon

Expand|Select|Wrap|Line Numbers
  1. var optionsDiv = document.createElement('div');
  2.     optionsDiv.className = 'ccLayerOptionsOverlayOptions';
  3.     optionsDiv.id = divId;
  4.     //Table with options
  5.     var table = document.createElement('table');
  6.         var opacityTr = document.createElement('tr');
  7.             var opacityLabel = document.createElement('td');
  8.                 opacityLabel.innerHTML = '<b>Opacity: </b>';
  9.             var opacityControls = document.createElement('td');
  10.                 var opacityValue = document.createElement('input');
  11.                     opacityValue.id = opId;
  12.                     opacityValue.className = 'opacity';
  13.                     opacityValue.type = 'text';
  14.                     opacityValue.value = '1.0';
  15.                     opacityValue.disabled = true;
  16.                 var decOpacity = document.createElement('a');
  17.                     decOpacity.title = 'decrease opacity';
  18.                     decOpacity.href = "javascript: ChangesClient.Util.changeOpacity(-0.1,ChangesClient.map.getLayer('" + divId + "'),'" + opId + "')";
  19.                     var minImg = document.createElement('img');
  20.                         minImg.className = 'button';
  21.                         minImg.src = ChangesClient._getScriptLocation() + "lib/styles/minus.jpg";
  22.                     decOpacity.appendChild(minImg);
  23.                 var incOpacity = document.createElement('a');
  24.                     incOpacity.title = 'increase opacity';
  25.                     incOpacity.href = "javascript: ChangesClient.Util.changeOpacity(0.1,ChangesClient.map.getLayer('" + divId + "'),'" + opId + "')";
  26.                     var plusImg = document.createElement('img');
  27.                         plusImg.className = 'button';
  28.                         plusImg.src = ChangesClient._getScriptLocation() + "lib/styles/plus.jpg";
  29.                     incOpacity.appendChild(plusImg);
  30.                 opacityControls.appendChild(opacityValue);
  31.                 //opacityControls.appendChild(" ");
  32.                 opacityControls.appendChild(decOpacity);
  33.                 //opacityControls.appendChild(" ");
  34.                 opacityControls.appendChild(incOpacity);
  35.             opacityTr.appendChild(opacityLabel);
  36.             opacityTr.appendChild(opacityControls);
  37.         var posTr = document.createElement('tr');
  38.             var posLabel = document.createElement('td');
  39.                 posLabel.innerHTML = '<b>Change Position: </b>';
  40.             var posControls = document.createElement('td');
  41.                 var posUp = document.createElement('a');
  42.                     posUp.title = 'move layer up';
  43.                     posUp.href = "javascript: ChangesClient.layerOptionsPanel.changeLayerIndex('" + divId + "',1)";
  44.                     posUp.innerHTML = 'up';
  45.                 var posDown = document.createElement('a');
  46.                     posUp.title = 'move layer down';
  47.                     posUp.href = "javascript: ChangesClient.layerOptionsPanel.changeLayerIndex('" + divId + "',-1)";
  48.                     posUp.innerHTML = 'down';
  49.                 if (layerIndex < maxOverlayIndex) {
  50.                     posControls.appendChild(posUp);
  51.                     if (layerIndex > minOverlayIndex) {
  52.                         //posControls.appendChild(" | ");
  53.                         posControls.appendChild(posDown);
  54.                     }
  55.                 } else if (layerIndex > minOverlayIndex) {
  56.                     posControls.appendChild(posDown);
  57.                 }
  58.             posTr.appendChild(posLabel);
  59.             posTr.appendChild(posControls);
  60.         table.appendChild(opacityTr);
  61.         table.appendChild(posTr);
  62.     optionsDiv.appendChild(table);
  63.  
Feb 14 '08 #1
3 2996
acoder
16,027 Expert Mod 8TB
IE for some reason requires the tbody tag. You will need to append the table rows to the tbody which should be appended to the table tag.
Feb 14 '08 #2
Thanks, I should have known that really!

Cheers,
Jon
Feb 15 '08 #3
acoder
16,027 Expert Mod 8TB
No problem. You're welcome!
Feb 15 '08 #4

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

Similar topics

2
by: c.anandkumar | last post by:
Hi All - I have some problems getting a small piece of javascript working correctly for Firefox. Here is what I am trying to do - 1. I have a form (like a search form) 2. I have many groups...
1
by: Gh! | last post by:
How can I see how much disk space is being occupied by an InnoDB table? Looking into /var/lib/mysql doesn't seem to work anymore for InnoDB tables. Please tell also if there is a way to see how...
1
by: Rich | last post by:
Hello, I am trying to draw a graph on a form. I can draw the box using drawline, and bars inside the box using drawrectangle, but when I try to draw a line inside the box the inner lines are...
5
by: outstretchedarm | last post by:
I'm extremely new to javascript and to programming in general. I am trying to create an interactive table. I have already created the table with constants, in the key of C (it is for music). ...
5
nmm32
by: nmm32 | last post by:
I have a DataGrid which displays data with the aid of a procedure. I have tested the procedure inside the database and it is working fine. I have another procedure which adds another row to the...
0
by: cms3023 | last post by:
I have a DataGrid which displays data with the aid of a procedure. I have tested the procedure inside the database and it is working fine. The table inside the database has data that matches with...
3
by: reelrave | last post by:
Hello All, I've checked around a little on Google (and this group) and have found info similar to what I'm trying to do (i.e., changes that were made in the BE's tables are not reflected in the...
2
by: bnashenas1984 | last post by:
Hi everyone I have a table in MySQL which contains menus and submenus. Table : + ID + Parent ID + Name + | 1 | 0 | Computer | | 2 | 0 | furniture | | 3 | ...
0
by: sarangrao | last post by:
i created one sqldatareader that reads parent table records. While(dr.Read()) inside this while i create another sqldatareader and new command that reads child table records.but it is giving an...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...
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...

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.