Jump to content

[SOLVED] Table inside a Div ?


mwl707

Recommended Posts

Hi I have a page with a div box. By default it is set to "hidden". On a click I want to make the box visible and then subject subject to conditions, draw a table inside the div (At this stage it is just a 10x10 table) ,

When I do click and run the javascript function  I dont get the div box just get a blank page with the table, Can anyone help me please  ?

I hope I have included all the information needed . Thanks

 

from my page I call the function visible()

 

function visible() {

document.getElementById("window").style.visibility = "visible";

drawallocatetable()

 

function drawallocatetable() {

document.write('<center><table width="200" border="0">');

for (j=1;j<=10;j++) {

          document.write('<tr>');

for (i=1;i<=10;i++) {

          document.write('<td>' + i*j + '</td>');

}

          document.write('</tr>');

}

          document.write('</table></center>');

}

 

my HTML/PHP code contains this Div tag and at this stage no table is drawn

 

<div id='window' >The Title </div>

 

and this in the <style> ,

 

#window {

position:absolute ;

width: 600px;

height:400px;

background-color:#39C ;

border: 4px solid black;

z-index:1 ;

visibility:hidden ;

left:50% ;

margin-left:-300px;

Link to comment
https://forums.phpfreaks.com/topic/174994-solved-table-inside-a-div/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.