title: JavaScript Create Calendar Table in DOM
body: <p>I have created a table with 6 rows and  5 cols. The table is created for each month having presumably  different number of days. I would like each col to display a date from 1-30 or 1-31 (depending on the month).</p>
  
  <p>This is what  I have so far:</p>
  
  <pre><code>function daysOfMonth(){
    var table= " ";
    var rows= 3;
     var cols=6;
    var number= 31;
    for(var r=0; r&lt;rows; r++){
      table+= "&lt;tr&gt;";
          for(var c=0; c&lt;=cols; c++){
                  table+= "&lt;td&gt;" + c +"&lt;/td&gt;"
        // each col should display number for(var i=0l i&lt;=number; i++)
      }
  
  table+= "&lt;/tr&gt;"
   }
  document.write('&lt;table&gt;' + table +"&lt;/table&gt;")
  
  };// func end
  </code></pre>
  
  <p>Here is a codepen   <a href="http://codepen.io/cb42/pen/KNJWrd" rel="nofollow noreferrer">http://codepen.io/cb42/pen/KNJWrd</a></p>