title: How to limit number of words per line to a fixed width?
body: <p>Hi guys I am trying to figure out how to limit the amount of words generated per line via javascript. These words are used with the span tag, so each word is separate and the words come from an array and are just iterated out. I want to have it stop printing words when two lines are full. Suggestions?</p>
  
  <pre><code>&lt;div id="container"&gt;
          &lt;div id="wordsBox"&gt;
          &lt;span wordnum="1" class&gt; Test &lt;/span&gt;
          &lt;span wordnum="2" class&gt; Test &lt;/span&gt;
          &lt;span wordnum="3" class&gt; Test &lt;/span&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>container is 960px, so I want to figure out how to stop generating spans once two lines fill up.</p>