title: Replace tr shows wrong results while using jQuery objects
body: <p>i am trying to construct a tr and then replace with the first row of a html table.
  I have a variable <code>newHeaderRow</code> in which i add jQuery objects and then i use <code>replaceWith</code> to replace the first row of the table with this variable.
  The problem is that no dom elements is being added in the table however it just show</p>
  
  <p>[object object] [object object][object object] </p>
  
  <p>in the place of the first row</p>
  
  <p><strong>To be specific</strong> </p>
  
  <p>I have 3 parts in my code where i create dom elements like </p>
  
  <pre><code>     result = $("&lt;td/&gt;",
       {
         align: "center",
         colspan: var1
      }).text("something");
  
      newHeaderRow += result;
  </code></pre>
  
  <p>and after some tds added in the newHeaderRow i use </p>
  
  <pre><code>     $('tr[class*="row#"]').eq(n)
          .replaceWith(newHeaderRow);
  </code></pre>
  
  <p>to replace the row.</p>
  
  <p>I know that if i use plain javascript and i use something </p>
  
  <pre><code>result =  "&lt;td  align='center'  colspan='" + countGroupBys + "'&gt;" + "something" + "
    &lt;/td&gt;"
  </code></pre>
  
  <p>and i add 3 strings in the newHeaderRow and then use replaceWith it will work.
  But i do not want my code to have long and not easy to read strings.</p>
  
  <p>In jQuery terms how can i pass the dom elements in the replace with and change the table?</p>