Home  |  About  | Last |  Submit  |  Contact
AllQuests.com

Previous Question:  The General Perception of Motor Scooters GameTrailers.com Forums  General DiscussionNext Question:  Validation help needed Urgent  Scripting Client Side
Question create table dynamically ( CodeGuru Forums Scripting Client Side )
Updated: 2008-08-12 06:09:02 (2)
create table dynamically

hi all

I am new in javascript. I am tring to create table dynamically in my .aspx page. After some googling I reached this code.
Code:
<script language ="javascript"> function fncCreateTable() { var ph = document.getElementById('PlaceHolder1'); var tb = document.createElement('table'); var row, col; var i,j; for (i = 0; i < 7; i++) { row=document.createElement('tr'); for (j = 0; j < 7; j++) { col = document.createElement('td'); row.appendChild(col); } tb.appendChild(row); } tb.appendChild(tbo); ph.appendChild(tb); } </script>


According to me the table is creating but the place holder is not getting it.

any idea, suggestions will be appreciable

Thank you

Answers: create table dynamically ( CodeGuru Forums Scripting Client Side )
create table dynamically

Thanks

I solve the problem
I removed the placeHolder from my form and added 'DIV' to be used instead of placeholder and then added my table to DIV

Same as my above code but the line
Code:
var ph = document.getElementById('div');

ujjwalmeshram

create table dynamically

The code you provided is correct. It will append a 7x7 table to whatever element has the id PlaceHolder1. To what have you given the id PlaceHolder1?



Previous Question:  The General Perception of Motor Scooters GameTrailers.com Forums  GameTrailers.com Forums  General DiscussionNext Question:  Validation help needed Urgent  CodeGuru Forums  Scripting Client Side

- Source: create table dynamically CodeGuru Forums Scripting Client Side
- Previous Question: The General Perception of Motor Scooters GameTrailers.com Forums GameTrailers.com Forums General Discussion
- Next Question: Validation help needed Urgent CodeGuru Forums Scripting Client Side





AllQuests.com