the problem is:
i created a div element with document.createElement()
than i created a talbe element,with all its' trs and tds and append it to the div's child nodes.
but the table cannot be displayed
here is the source code
function createTable(rownum,colnum)
{
tableobj=document.createElement("TABLE"
;
for(i=1;i<=rownum;i++)
{
trobj=document.createElement("TR"
;
for(j=1;j<=colnum;j++)
{
tdobj=document.createElement("TD"
;
tdobj.id="c"+i+j;
trobj.appendChild(tdobj);
}
tableobj.appendChild(trobj);
}
tableobj.id="inputtable";
return tableobj;
}
function createPanel(panelwidth,panelheight)
{
clearAll();
panelobj=document.createElement("DIV"
;
panelobj.id="inputpanel"
panelobj.style.backgroundColor="#ffee00";
panelobj.style.position="absolute";
panelobj.style.width=panelwidth;
panelobj.style.height=panelheight;
panelobj.style.left=event.clientX+document.body.scrollLeft;
panelobj.style.top=event.clientY+document.body.scrollTop;
panelobj.style.visibility="visible";
return panelobj;
}
function selectitem16()
{
var panelobj=createPanel(200,100);
tableobj=createTable(2,5);
tableobj.width=100;
tableobj.height=50;
tableobj.border=2;
panelobj.appendChild(tableobj);
document.body.appendChild(panelobj);
}
THANK YOU VERY MUCH IF U CAN HELP ME!
i created a div element with document.createElement()
than i created a talbe element,with all its' trs and tds and append it to the div's child nodes.
but the table cannot be displayed
here is the source code
function createTable(rownum,colnum)
{
tableobj=document.createElement("TABLE"
for(i=1;i<=rownum;i++)
{
trobj=document.createElement("TR"
for(j=1;j<=colnum;j++)
{
tdobj=document.createElement("TD"
tdobj.id="c"+i+j;
trobj.appendChild(tdobj);
}
tableobj.appendChild(trobj);
}
tableobj.id="inputtable";
return tableobj;
}
function createPanel(panelwidth,panelheight)
{
clearAll();
panelobj=document.createElement("DIV"
panelobj.id="inputpanel"
panelobj.style.backgroundColor="#ffee00";
panelobj.style.position="absolute";
panelobj.style.width=panelwidth;
panelobj.style.height=panelheight;
panelobj.style.left=event.clientX+document.body.scrollLeft;
panelobj.style.top=event.clientY+document.body.scrollTop;
panelobj.style.visibility="visible";
return panelobj;
}
function selectitem16()
{
var panelobj=createPanel(200,100);
tableobj=createTable(2,5);
tableobj.width=100;
tableobj.height=50;
tableobj.border=2;
panelobj.appendChild(tableobj);
document.body.appendChild(panelobj);
}
THANK YOU VERY MUCH IF U CAN HELP ME!