A
alxwest
Hi
I'm trying to spread a table across a frameset. So I have index.htm
that has an iframe sourcing the frameset. What I'm trying to do is
create a table in index.htm to spread across the whole brower window.
My code, ran from within the frameset:
function Createtbl(){
var tbl = document.createElement('table');
tbl.height = "100%";
tbl.style.height = "100%";
tbl.width = "100%";
tbl.style.width = "100%";
var newRow = tbl.insertRow(-1);
var newCell = newRow.insertCell(-1);
newCell.innerHTML = "hello world";
var holder = top.document.createElement('div');
top.document.appendChild(holder);
holder.outerHTML = tbl.outerHTML;
}
The above doesn't work, the below only works in ie
If in index.htm I create a div tag with the id "holder":-
function Createtbl(){
var tbl = document.createElement('table');
tbl.height = "100%";
tbl.style.height = "100%";
tbl.width = "100%";
tbl.style.width = "100%";
var newRow = tbl.insertRow(-1);
var newCell = newRow.insertCell(-1);
newCell.innerHTML = "hello world";
var holder = top.document.getElementById('holder');
holder.outerHTML = tbl.outerHTML;
}
Any ideas to get this to work in firefox? And create the "holder"
dynammically?
NB: creating the table can't be top.document.createElement as the code
the generate it is another function used for various things.
Cheers
Alex
I'm trying to spread a table across a frameset. So I have index.htm
that has an iframe sourcing the frameset. What I'm trying to do is
create a table in index.htm to spread across the whole brower window.
My code, ran from within the frameset:
function Createtbl(){
var tbl = document.createElement('table');
tbl.height = "100%";
tbl.style.height = "100%";
tbl.width = "100%";
tbl.style.width = "100%";
var newRow = tbl.insertRow(-1);
var newCell = newRow.insertCell(-1);
newCell.innerHTML = "hello world";
var holder = top.document.createElement('div');
top.document.appendChild(holder);
holder.outerHTML = tbl.outerHTML;
}
The above doesn't work, the below only works in ie
If in index.htm I create a div tag with the id "holder":-
function Createtbl(){
var tbl = document.createElement('table');
tbl.height = "100%";
tbl.style.height = "100%";
tbl.width = "100%";
tbl.style.width = "100%";
var newRow = tbl.insertRow(-1);
var newCell = newRow.insertCell(-1);
newCell.innerHTML = "hello world";
var holder = top.document.getElementById('holder');
holder.outerHTML = tbl.outerHTML;
}
Any ideas to get this to work in firefox? And create the "holder"
dynammically?
NB: creating the table can't be top.document.createElement as the code
the generate it is another function used for various things.
Cheers
Alex