Hi Manfred,

I haven't audited the code carefully, but I see that you're appending
TR elements directly to TABLE elements.  Depending on your doctype,
that may be invalid.  The modern way is that TABLE elements contain
TBODY elements (and, optionally, THEAD elements), which in turn
contain TRs.  Most browsers will tolerate it if you don't do that with
literal HTML (they insert the TBODY for you when parsing), but perhaps
IE isn't doing that when you go straight to the DOM and build things
up yourself.  Easy enough to try it and see if that's what's wrong.

BTW, FWIW, if this is a really big table, you _may_ find that you get
better performance building up an HTML string and then letting the
browser interpret the string (you can put a div where you want the
table to be, then use Element#update on the div and pass in the
string).  Browsers are really optimized around parsing HTML and
building up the necessary internal structures, whereas their DOM
access methods can be markedly slower.  Depends on the browser and
version.  And again, if the table is small, it doesn't matter.

T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available

On Jan 17, 8:03 pm, knoppsie <manfred.kn...@freenet.de> wrote:
> Hello together,
> I used prototype to create a website.
> One part for prototype is to delete a table and create it new.
> Here the sourcecode:
> // Wenn die Unterliste existiert,
> // wird sie beim nächsten Mausklick gelöscht.
>     var tableLoeschen = document.getElementById('galleryTable');
>     tableLoeschen.parentNode.removeChild(tableLoeschen);
>     }
> // Aus dem erhaltenen JSON String eine Array erzeugen.
>   var array = transport.responseText.evalJSON();
> // Eine Tabelle definieren.
> // Die Tabelle enthält nur eine Spalte und entsprechend viele Zeilen.
>   var table =  new Element('table', { 'id': 'galleryTable', 'align':
> 'right', 'border': '5' });
>   $('rechts').appendChild(table);
> // Fuer jeden Wert des erhaltenen Arrays neue TR- und TD-Tags
> // definieren und einhaengen.
>   for ( var i = 2; i<array.length; i = i + 3 )
>     {
>     // Wenn die Galerieansicht geaendert wird, soll das erste Produkt
>     // in der Mitte angezeigt werden.
>     if (i == 2) showFirstItem(na, array[i], array[i-1]);
>     var trId = "tr_"+array[i];
>     var tr = new Element('tr', { id: trId });
>     $('galleryTable').appendChild(tr);
> // Definition 4-spaltige Tabelle
>     for (j=0;j<4;j++)
>     {
>         if (!array[i]){
>             break;
>         };
>         var tdId = "td_"+array[i];;
>         var td = new Element('td', { id: tdId });
>         $(trId).appendChild(td);
>         var imgId = "img_"+array[i];
>         var imgFile = "./images/"+na+"/"+array[i]+".jpg";
>         var gallerieFunktion = "item("+array[i-2]+", '"+na+"')";
>         var img = new Element('img', { id: imgId , src: imgFile, alt:
> array[i], width: "80px", height: "80px", onMouseover:
> gallerieFunktion });
>         $(tdId).appendChild(img);
>         i=i+3;
>         }
>     }
> It works in firefox, konqueror and opera.
> In internet explorer the new tables are not visible.
> I installed the debug bar. In the debug bar I checked the DOM. The
> debug bar shows me the new table. But it isn't visible. Where is the
> problem?
> If someone will visit the site. Here is the 
> urlhttp://www.gerrits-worlddecor.de/neu/handcraft.php.
> For example you can click on Bont or Coffee.
> Regards
> Manfred
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to