||05-01-2013 09:24 PM
Cloning a table as child to each cloned cells
I am using Internet Explorer 8
I have 2 Tables
Table1: 1 row 2 columns
Table2: 1 row 1 column
I want to clone table 1 to table 2 making it a child of the cell.
I thent want to clone Table1 making it a child to each of the cloned cells and so on.
The posted code is as close as I have gotten.
function Clone ()
var clonedTable = srcTable.cloneNode (true);
clonedTable.id = ""; // clear the id property of the cloned table
while(u != null)
if (u != null)
<table id="srcTable" border="1px">
<table id="srcTable2" border="1px">
<br /><br />
<button onclick="Clone();">Clone Table!</button>
As you can see from the script I can clone Table1 making it a child of the cell in table 2 but can only make further children in row1 column 1 of the children and cannot access the other 2 cells.
Any help would be gratefully received.
Many thanks in advance.
||05-12-2013 04:52 PM
Please check your code:
each time you call Clone() function, it is accessing 1st cell of 1st row and it is getting cloned in same cell.
You need to check the whole table and find out the empty cells and append trhe cloned table into it each time.
||05-19-2013 09:58 PM
Yes I know it is accessing 1st cell of 1st row and it is getting cloned in same cell.
I did say this in my description. The problem is how to access the rest of the cells within the cloned table.
Any other thoughts as to how this can be achieved would be very welcome.#
with thanks in advance
|All times are GMT +1. The time now is 11:46 PM.
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.