title: How to add a line break every 3 times in a for loop
body: <p>In a weather widget I have this for loop for an hourly forecast, but I need it split into 4 lines of 3 instead of a single line with 12 items, how do I add a line break every 3rd time? Here is my for loop:</p>
  
  <pre><code>for (var i = 0; i&lt;12; i++) {
      document.getElementById("Hicon" + i).style.left = 1.4 +  8.333*i + "%";
      document.getElementById("Hpop" + i).style.left = 2.5 +  8.333*i + "%";
      document.getElementById("Hour" + i).style.left = 1.57 +  8.333*i + "%";
      document.getElementById("Htemp" + i).style.left = 1.3 +  8.333*i + "%";
  }
  </code></pre>
  
  <p>Here is my css for Hicon, the css for the other 3 elements are much the same:</p>
  
  <pre><code>#Hicon0, #Hicon1, #Hicon2, #Hicon3, #Hicon4, #Hicon5, #Hicon6, #Hicon7, #Hicon8, #Hicon9, #Hicon10, #Hicon11 {
      position: absolute;
      top: 5%;
      left: 1.4%; /* set in main.js */
      width: 5.5%;
      height: 40%;
  }
  </code></pre>
  
  <p>Here is HTML for the Hicon, other items are the same format inside the hourlyforecast div.</p>
  
  <pre><code>    &lt;div id="hourlyforecastContainer" class="scaleZero"&gt;
          &lt;div id="hourlyforecast"&gt;
              &lt;div id="hourlyforecastBG"&gt;&lt;/div&gt;
              &lt;img id="Hicon0" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon1" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon2" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon3" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon4" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon5" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon6" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon7" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon8" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon9" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon10" src="Icon Sets/blank.png"/&gt;
              &lt;img id="Hicon11" src="Icon Sets/blank.png"/&gt;
  </code></pre>