473,387 Members | 1,541 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.

elements displayed in FF but not in IE

Hello,

I try to create a calendar. It's done, it's works fin in Firefox, but
it's not displayed in Internet Explorer.
Structure:
createElement("div"); append.document.body
createElement("table"); append. the div above
createElement("tr"); append to table
createElement("td"); append to tr

I try to debug this problem and I figure out that if I give a dimension
to div (height and width) it will apear on the page. Any ideas?

Dec 15 '06 #1
4 1376
ASM
Iulian Ilea a écrit :
I try to create a calendar. It's done, it's works fin in Firefox, but
it's not displayed in Internet Explorer.
Answer wasn't given ?
(to you or your fellow)
Structure:
why don't you give your real code ?
How to see where you're wrong ?
createElement("div"); append.document.body
createElement("table"); append. the div above
I prefer append the table when it is complete

create div

create table

create tbody <---- here what missing for IE

create tr

create td append td to tr
create td append td to tr

append tr to tbody
append tbody to table
append table to div
append div to document.body
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 15 '06 #2
Iulian Ilea wrote:
Hello,

I try to create a calendar. It's done, it's works fin in Firefox, but
it's not displayed in Internet Explorer.
Structure:
createElement("div"); append.document.body
createElement("table"); append. the div above
createElement("tr"); append to table
createElement("td"); append to tr

I try to debug this problem and I figure out that if I give a dimension
to div (height and width) it will apear on the page. Any ideas?
When using createElement/appendChild for table rows, IE wants you to
add them to a tbody element, not directly to the table element. So you
can either create a tbody, append it to the table, then append rows to
that, or you can create a table and use the insertRow() method[1]:

var numRows = 6;
var numCells = 7;
var table = document.createElement('table');
var row, cell;
for (var i=0; i<numRows; i++){
row = table.insertRow(-1);
for (var j=0; j<numCells; j++){
cell = row.insertCell(-1);
cell.innerHTML = 'Row ' + i + ' cell ' + j;
}
}
document.body.appendChild(table);

Ensure you use appropriate feature detection.
1. <URL: http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-39872903 >

--
Rob

Dec 16 '06 #3
RobG said the following on 12/15/2006 7:21 PM:
Iulian Ilea wrote:
>Hello,

I try to create a calendar. It's done, it's works fin in Firefox, but
it's not displayed in Internet Explorer.
Structure:
createElement("div"); append.document.body
createElement("table"); append. the div above
createElement("tr"); append to table
createElement("td"); append to tr

I try to debug this problem and I figure out that if I give a dimension
to div (height and width) it will apear on the page. Any ideas?

When using createElement/appendChild for table rows, IE wants you to
add them to a tbody element, not directly to the table element.
IE along with the specs say add them to a tbody. It should be noted that
IE is correct with regards to this and that Opera/Mozilla/etc.. get it
dead wrong.

You see enough IE bashing so Moz/Opera should get it when they deserve it :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 16 '06 #4

Randy Webb wrote:
RobG said the following on 12/15/2006 7:21 PM:
Iulian Ilea wrote:
Hello,

I try to create a calendar. It's done, it's works fin in Firefox, but
it's not displayed in Internet Explorer.
Structure:
createElement("div"); append.document.body
createElement("table"); append. the div above
createElement("tr"); append to table
createElement("td"); append to tr

I try to debug this problem and I figure out that if I give a dimension
to div (height and width) it will apear on the page. Any ideas?
When using createElement/appendChild for table rows, IE wants you to
add them to a tbody element, not directly to the table element.

IE along with the specs say add them to a tbody. It should be noted that
IE is correct with regards to this and that Opera/Mozilla/etc.. get it
dead wrong.

You see enough IE bashing so Moz/Opera should get it when they deserve it :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Thanks all, this was the problem. I was out of the city yesterday and I
had no connection to internet, that is way my answer is so delayed. I
have just started to work with DOM and I learn new things every day.

Thanks again,

Iulian

Dec 17 '06 #5

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

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
3
by: Henning Heil | last post by:
hello all! I have a little problem with a DHTML feature which works fine with most browsers but not with NS4. an example can be found here:...
5
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial...
258
by: Terry Andersen | last post by:
If I have: struct one_{ unsigned int one_1; unsigned short one_2; unsigned short one_3; }; struct two_{ unsigned int two_1;
0
by: manju | last post by:
Hi, I use DHTML browser as my main application window and I create elements like <p>, <table>, <img> etc dynamically using MSHTML C++ interfaces like IHTMLDocument2::createElement...
5
by: Ed Jay | last post by:
I have a switch statement that controls which of several containers is displayed or not. It currently looks like: function showHelp(n) { show('vhelp'); //makes parent container visible switch...
1
by: sarafraz | last post by:
I want to process the XML File and display it in the browser(IE). I have the written code which accepts the XML file as input,parses it and displays it in IE with proper indentation. To achieve...
4
by: Claudio Calboni | last post by:
Hello folks, I'm having some performance issues with the client-side part of my application. Basically, it renders a huge HTML table (about 20'000 cells in my testing scenario), without content....
2
by: mars123 | last post by:
hi, I am facing a js error in my code, below is the prob. statement I have a radio2 javascript function as below, it works like this.. When a parent radio button is selected only one of its...
13
by: ed08857 | last post by:
Hello, I have a table that I use to display data. When the the page is displayed in FF, table elements appear the same size as the text outside of the table, and that's what I want. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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: 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
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...
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.