title: jQuery - Divide width of the wrapper to the number of div`s inside
body: <p>I need some help. I have a div wrapper and some other div's inside that will be added dynamically. The number of div's inside will be random so I need a script that will know how many div's are inside and which will be the width of the div's to fit in the wrapper perfectly.</p>
  
  <pre><code>&lt;div id="wrapper"&gt;
  &lt;div class="block"&gt;A1&lt;/div&gt;
  &lt;div class="block"&gt;A2&lt;/div&gt;
  &lt;div class="block"&gt;A3&lt;/div&gt;
  &lt;div class="block"&gt;A4&lt;/div&gt;
  &lt;div class="block"&gt;An&lt;/div&gt;
  &lt;/div&gt;
  &lt;style&gt;
  #wrapper {width:1000px;}
  div.block {margin:0 0 20px 20px; border:1px solid #ccc;}
  &lt;/style&gt;
  </code></pre>
  
  <p>If you can consider the margins and border will be great!
  Thank you!</p>
  
  <p>This is my script. It`s good, but not good handling the margins.</p>
  
  <pre><code>var ct = $('#wrapper').children().size();
  var dw = $('#map').width() / (ct) - 25;
  $("div.block").width(dw);
  </code></pre>
  
  <p>Thanks to the answers below I made the script work! 
  Thank you all!</p>