473,473 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

duplicate my table

gk
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<form name="form1" method="post" action="">
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="430" border="1">
<tr>
<td width="59" height="34">r1</td>
<td width="59">r2</td>
<td width="290"> value </td>
</tr>
<tr>
<td height="37">abcd</td>
<td>efgh</td>
<td>123</td>
</tr>
<tr>
<td height="43">asswe</td>
<td>rtgh</td>
<td>345</td>
</tr>
</table>
<p>&nbsp;</p>
</form>
</body>
</html>

can i duplicate this table 5 times in my page via javascript ? how ?

Oct 27 '05 #1
3 4788
> can i duplicate this table 5 times in my page via javascript ? how ?

form = document.forms[0];
table = form.getElementsByTagName('table')[0];
for (i=0;i<5;i++) {
form.appendChild(table.cloneNode(true));
}

Oct 27 '05 #2
gk
i am sending XML...

var xml ==<< feedind xml data in every 10 secs interval upto for 50
secs.

// get the XML and parse it.

put the data into the table. so we'll shave 5 tables this way after 50
secs.

you have shouwn how to duplicate the table. but i also want to know how
to set the data .

i need it for dynamic page updation.

Oct 27 '05 #3
> you have shouwn how to duplicate the table. but i also want to know how
to set the data .


Much trickier then :-)
// Use XMLHTTPRequest, i will call the object http
// and the elements within that signify tr groups <row>
xml = http.returnedXML;
rows = xml.getElementsByTagName('row');
form = document.forms[0];
table = document.createElement('table);
form.appendChild(table);
for (i=0;i<rows.length;i++) {
tr = document.createElement('tr');
table.appendChild(tr);
cells = row.childNodes;
for (j=0;j<cells.length;j++) {
td = document.createElement('td');
tr.appendChild(td);
txt = document.createTextNode(cells[i].firstChild.nodeValue);
td.appendChild(txt);
}
}

You will have to clean this up a bit to work with your data structures,
of course. Hope it helps.

Oct 27 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Giloosh | last post by:
Hello, i need some help if possible... i have a payments table with over 500 records i want to run a query that searches through the table spotting out any duplicate ID#'s and Dates. So basically...
2
by: Pablo | last post by:
Hello, there, I have a table tblData which has pharmacy data. The table has following fields: ClaimNum, LineNum... The ClaimNum has claim number which is 12 characters. LineNum is NULL. The...
12
by: Jared Carr | last post by:
First I wish I knew how this was caused but here is our problem. Sometime in the recent past we got a duplicate table. Here is the result of a pg_dump with a pg_restore for just that table. ...
7
by: Jon Maz | last post by:
Hi, I have a MySql problem I hope someone can help me with. I'm trying to run an update on a linking table, the update is running into a Primary Key constraint violation, and in my workaround...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
4
by: FangQ | last post by:
hi I am very new to mysql. I have a question about using the "on duplicate update" clause with insert command. my table "data" has two columns, field1 and field2, where field1 is the index...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
2
by: Carroll | last post by:
I'm looking for a way in SQL to find duplicate records in a single table, that are the same based on 3 columns, regardless of what is in the other columns in the duplicate records. I would like to...
3
by: rajeshkrsingh | last post by:
Hi friends, Step1- create table duplicate ( intId int, varName varchar(50) ) insert into duplicate(intId,varName) values(1,'rajesh') insert into duplicate(intId,varName) values(2,'raj12')...
4
by: ramdil | last post by:
Hi All I have table and it have around 90000 records.Its primary key is autonumber field and it has also have date column and name, then some other columns Now i have problem with the table,as my...
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
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
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...
1
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...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.