append - Jquery cloned objects from multiple locations appending into same container -


I have two tables on one page that are being used terribly for layout purposes. Need to move into two containers, one for each table I am working with the following HTML.

  & lt; P & gt; Paragraph of some goods & Lt; / P & gt; & Lt; Table & gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; TD & gt; Image & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Image & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; P & gt; More stuff with paragraphs & lt; / P & gt; & Lt; Table & gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; TD & gt; Image & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> & Lt; Em> Some fancy text & lt; / Em> & Lt; / Td> & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;  

I can not open the existing tables. I have to modify the clone contents so that I am creating some new containers before each table, where I rotate the contents from the table using the jacquis And I want to open it, then wrap it in some other legal elements.

The problem is that I can not understand all the clone elements to add to their own special containers before the abusive table. I use this jquery:

  $ ('table'). Each (function () {$ (this). Earlier ('& lt; div class = "ae-replacetable"> <$ (' 'TD' '). $ (' Td '). Attachment ($ (this) .clone ());});}); $ ('.ee-replaceTable img'). Rap ​​('& lt; p & Gt; & lt; / p & gt; '); $ (' .e-replaceTable td '). Children (). Opening ();  

But whatever I end up I am from both tables in both containers, I need to be separated in the container made for them, which comes from the specific table which comes from it. 1 and ends in Table 2. Everything ends at 2.

  & lt; p & gt; Paragraphs of some goods. & Lt; / p & gt; ; 
gt; & lt; p & gt; image & lt; / p & gt; & lt; p & gt; image & lt; / p & gt; & lt; / Div> & lt; Table & gt; & lt; tbody & gt; & lt; tr & gt; & lt; td & gt; Image 1 & lt; / td & gt; & lt; / tr & gt; ; & Lt; tr & gt; & lt; td & gt; Image 2 & lt; / td & gt; & lt; / tr & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; P & gt; More stuff with paragraphs & lt; / P & gt; & Lt; Div class = "ae-replacetable" & gt; & Lt; P & gt; Image 3 & lt; / P & gt; & Lt; P & gt; Some fancy lessons & Lt; / P & gt; & Lt; / Div & gt; & Lt; Table & gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; Td> Image 3 & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> & Lt; P & gt; Some fancy lessons & Lt; / P & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;

Thanks advance!

Edit for clarification: I have this problem on the site that I am working so that I can not go through each page Unique class for each table container to solve it Must be able to use the class name.

This is very primitive, but we can reach it if you wish.

JS

  $ ('# copy'). ('Click', function () {$ ("upper tr TD: eq (0)"). Clone () .Append ('TapeTable'); $ ("Upper Trance TD: eq (1)") Clone () .appendo ('$ (".ht TR: eq (0)") .clone () .andandto (' tobacco '); $ (".ht tr td: eq (1)"). Clone ( $. ('.tabletable'); $ ('.ptptable'). CSS ('display', 'block'); $ ('bottomtable'). CSS ('display', 'block');});  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -