title: Dithering child elements' dimensions to fill a parent element
body: <p>Say I have a parent div with width 500px. It has 13 child elements that should fill its width.</p>
  
  <p>If I give each child element a width of 500 / 13 = 38.46... pixels, the browser will floor the pixel values, so I end up with 13 elements that take up a total of 38 * 13 = 494 pixels. There will be 6 pixels on the right side of the parent div that are not filled.</p>
  
  <p>Is there an easy way to dither the child element widths so that the remainder (6 pixels) is distributed among some of the child elements, resulting in a total width of 500 pixels?</p>
  
  <p>If I have to do the calculations manually and there's no way to get the browser to manage it, what <a href="http://en.wikipedia.org/wiki/Dithering" rel="nofollow">dithering</a> <a href="http://en.wikipedia.org/wiki/Rounding#Simple_dithering" rel="nofollow">algorithm</a> might I use in this case?</p>
  
  <p><strong>EDIT:</strong> A clarification -- I'm doing these calculations on the client side using JavaScript. Also, the size of the parent div and the number of child divs vary at runtime; the figures above are just an example.</p>