📜 ⬆️ ⬇️

IE vs all or Hide and seek

Faced one (regular) problem of drawing tables using DOM in Internet Explorer (I have the current version 7.0.5730.13).
I called her Hide and Seek , although the working title was Blind Parent's Syndrome

First the code:
< html >
< head >
</ head >
< body >
< button onclick ="add_row()" > Add </ button >
< button onclick ="alert(document.getElementById('place').innerHTML)" > Show inner </ button >
< div id ="place" ></ div >

< script type ="text/javascript" >
var place = document .getElementById( "place" );
var table = document .createElement( "table" );
place.appendChild(table);

function add_row() {
var row = document .createElement( "tr" );
var c1 = document .createElement( "td" );
var c2 = document .createElement( "td" );

row.appendChild(c1);
row.appendChild(c2);

table.appendChild(row);

c1.innerHTML = "cell1" ;
c2.innerHTML = "cell2" ;
}
</ script >
</ body >
</ html >


* This source code was highlighted with Source Code Highlighter .


Also a link for self test.

And now I will tell in brief . Clicking the Add button creates a new row in a two-cell table. All this can be seen by clicking the Show inner button. But the problem is that IE does not draw this line on the page, although it carefully and responsibly remembers them and even objects in innerHTML .
')
I have not found a solution yet :(

Source: https://habr.com/ru/post/55850/


All Articles