Note that there are some explanatory texts on larger screens.

plurals
  1. POcolspane all columns of clone row
    primarykey
    data
    text
    <p>I want to merge all columns <code>(colspan)</code> in a new row which is created using <code>clone()</code> method of jquery . one more thing which i want that new row which have only one column after <code>colspan</code> should have all values of original row separated with space . </p> <p>I have tried something like this for <code>clone</code> and its working for me as far consider about <code>cloning</code> </p> <pre><code>$(document).ready(function(){ console.log($('table tbody tr').eq(0).html()); var newtr=$('table tbody tr').eq(0).clone(); console.log(newtr.html()); }); </code></pre> <p>but no idea how to <code>colspan</code> all columns with value of original row comma separated.</p> <p><a href="http://jsfiddle.net/rahularyansharma/3p3m2/1/" rel="nofollow">JS FIDDLE LINK</a> </p> <p><strong>EDITED</strong></p> <p>current html is like this </p> <pre><code>&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Order&lt;/th&gt; &lt;th&gt;Month&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Rahul&lt;/td&gt; &lt;td&gt;#1&lt;/td&gt; &lt;td&gt;January&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Yunus&lt;/td&gt; &lt;td&gt;#2&lt;/td&gt; &lt;td&gt;April&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Nitin&lt;/td&gt; &lt;td&gt;#3&lt;/td&gt; &lt;td&gt;March&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>and after jquery code run i want to my resulted html look like this </p> <pre><code>&lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Order&lt;/th&gt; &lt;th&gt;Month&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Rahul&lt;/td&gt; &lt;td&gt;#1&lt;/td&gt; &lt;td&gt;January&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Yunus&lt;/td&gt; &lt;td&gt;#2&lt;/td&gt; &lt;td&gt;April&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Nitin&lt;/td&gt; &lt;td&gt;#3&lt;/td&gt; &lt;td&gt;March&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt;Rahul #1 January&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload