473,769 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creation of table using method in DHTML page

22 New Member
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 1407
hsriat
1,654 Recognized Expert Top Contributor
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 New Member
function createTable(lis t)
{
alert(list);
var table= document.create Element('Table' );

table.border='1 ';
var tbdy=document.c reateElement('T BODY');
while(list)
{
var tr=document.cre ateElement('TR' );
tbdy.appendChil d(tr);
}

// table.appendChi ld(tbdy);
// var tr=document.cre ateElement('TR' );
// tbdy.appendChil d(document.crea teTextNode(Navd ip,Singh);

"list has total number of rows. which return web service"
Mar 28 '08 #3
hsriat
1,654 Recognized Expert Top Contributor
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
1848
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 users to turn-off this Pop-up after they've reviewed the changes. Currently, I'm debating whether to use cookies or build a table that will set flags. I'm not sure what the best solution to take would be. Does anyone know what would be the best...
1
4692
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. I believe that the problem is not with executing the code, but rather with the browser reparsing the page, or the table, or something.
2
8726
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 window to generate the tables. The basic idea is to add a table tag, with a thead and tbody, on the main parent page, that has display:none set. This then becomes display:block when there are rows to show. The rows themselves are added...
13
7409
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 created forms for both those tables, and inserted the child table form into the master table form as a subform. It works just as it is supposed to, in that I can create a new master record, and then add detail records.
1
3724
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 error. Here is the code: DHTMLEDLib.DEInsertTableParamClass oTableParam = new DHTMLEDLib.DEInsertTableParamClass(); oTableParam.NumCols = 3; oTableParam.NumRows = 3; oTableParam.TableAttrs = "align=\"left\" border=\"1\" width=\"100%\"";...
3
2992
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
2139
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 problem is this example only shows input box. Now i have a list that means a 'select box' for which the value is retrieved from Database and populated into the select list box. Now according to the example if all residing in the javascript how am i...
23
1648
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 assign values to all the attributes at __init__ time, as the values depend on attributes of other linked classes which may not have been created yet. I can be sure that by the time any values are requested, all the other classes have been created,...
4
1600
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 in one table and another that links the subset of questions to the particular form. When the user gets ready to answer the questions the app appends the questions to the answer table - all of which makes it easy to answer the questions within a...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.