473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

creation of table using method in DHTML page

22
i want to create a DHTML page in which i want to create a Table using method in JSCRIPT
in which i'll pass the number of rows and coloumns as arguments of method.
and table should get created when i call the method

please give me code if u can.....
Mar 28 '08 #1
3 1396
hsriat
1,654 Expert 1GB
i want to create a DHTML page in which i want to create a Table using method in JSCRIPT
in which i'll pass the number of rows and coloumns as arguments of method.
and table should get created when i call the method

please give me code if u can.....
An exiting thread may help you.

In that code given in that thread, table is already created, only rows and fields are added.

To add table use this:
Expand|Select|Wrap|Line Numbers
  1. var tbl     = document.createElement("table");
  2. var tblBdy = document.createElement("tbody");
  3. tbl.appendChild(tblBdy);
  4. document.getElementsByTagName("body")[0].appendChild(tbl);
Mar 28 '08 #2
Navdip
22
function createTable(list)
{
alert(list);
var table= document.createElement('Table');

table.border='1';
var tbdy=document.createElement('TBODY');
while(list)
{
var tr=document.createElement('TR');
tbdy.appendChild(tr);
}

// table.appendChild(tbdy);
// var tr=document.createElement('TR');
// tbdy.appendChild(document.createTextNode(Navdip,Si ngh);

"list has total number of rows. which return web service"
Mar 28 '08 #3
hsriat
1,654 Expert 1GB
Look at the code I gave you, and try to change it according to your needs.

First create the table and tbody, then append the table to the body, as I had done in the code above.

Then to create rows, look at the insR() function in the link I gave you, and copy line number 4 to 10 from that code.

Regards,
Harpreet
Mar 28 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Scott | last post by:
On an Intranet Web application I'm working on, I need to display a Pop-up that shows the users what report changes have occurred. This may happen once a week or more and I need a way for the...
1
by: Chris | last post by:
Can anyone help me on this one? I have a giant (couple thousand rows) HTML table. Im trying to modify some of the cells innerHTML and/or innerText, but it is taking a VERY long time to do so....
2
by: The_Original_MB | last post by:
I have a task to create tables dynamically, using the javascript DOM. The current method uses a 1px x 1px IFRAME to loop through some data generation stuff, and then call JS functions in the parent...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
1
by: dd | last post by:
Cannot figure it out. If somebody can help, I'd appreciate it. I am using DHTML Edit control from C# for editing HTML pages. I am trying to insert a table into an HTML page and I keep getting an...
3
by: Raed Sawalha | last post by:
Dear : I have an image in a aspx page I need when user mouseover it to display HTML Table with links. Regards
2
by: philin007 | last post by:
Hi Guys, Could any one help me out with codes to add rows to a table. Well I kinda of got the codes from the following site (http://www.interviewboard.com/DHTMLSamples/DHTMLGridSample.htm) the...
23
by: Frank Millman | last post by:
Hi all I have a small problem. I have come up with a solution, but I don't know if it is a) safe, and b) optimal. I have a class with a number of attributes, but for various reasons I cannot...
4
by: timmg | last post by:
I have an application were users evaluate records and based on the amount of money involved answer between 17 and a 120 questions on one of three response forms. I have a master list of question...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.