title: Order words by number of letters, then place words neatly
body: <p>I have a list of words in javascript <em>similar</em> to this:</p>
  
  <pre><code>var words = ["mine", "minute", "mist", "mixed", "money", "monkey", "month",
               "moon", "morning", "mother", "motion", "mountain", "mouth", "move",
               "much", "muscle", "music", "nail", "name", "narrow", "nation",
               "natural", "near", "necessary", "neck", "need", "needle", "nerve",
               "net", "new", "news", "night"];
  </code></pre>
  
  <p>The words can be 1-25? letters long.</p>
  
  <p>I have a <code>div id="words"</code>, with a set width of 700px (but I might change it from this).</p>
  
  <p>Using css/javascript/jquery, how can I make it:</p>
  
  <ul>
  <li>Order the words by number of letters</li>
  <li>Place the words inside the div tag, left to right, but so that there are no gaps at the right edge of the words div, and there is even spacing between words on a line.</li>
  <li>Each word should have a border around it and a background.</li>
  </ul>
  
  <p>Like this:</p>
  
  <pre><code>|reallylongwordssdf     shorterwordfdf     dfsdfsdfsdf     sdfsdfsdf|
  |sdfsdfsdf   sdffsdop   sdfjpogs   sdfsds   dfsdsd   dfsdsd   dfsdsd|
  </code></pre>
  
  <p>I really have no idea where to begin with this. Perhaps I could manage to write code to order the words by number of letters, but after that, I'd be stuck.</p>
  
  <p>Edit: <strong>I forgot to add, the words must be links.</strong></p>