title: jQuery append two tds' in one tr
body: <p>How to use jQuery to append only two tds' in a single tr ..</p>
  
  <p>I have a table .. I want to max how many tds per row.. something like this</p>
  
  <pre><code>if($("td").length) == 0){ // get the count of existing tds
   $("table").append("&lt;tr&gt;");
  }
     $("table").append("&lt;td&gt;Something&lt;/td&gt;");
  
  if($("td").length) == 2){ // if it hit two tds' in this tr then close the tag
   $("table").append("&lt;/tr&gt;");
  } // this is not a valid example, just trying to deliver my point
  </code></pre>
  
  <p>it's not a loop, it appends on click, so let's say I clicked <b>5</b> times, I should get this</p>
  
  <pre><code>&lt;tr&gt;
   &lt;td&gt;Someting&lt;/td&gt;
   &lt;td&gt;Someting&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Someting&lt;/td&gt;
   &lt;td&gt;Someting&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td&gt;Someting&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>