title: Array filter and Array Display
body: <p>I have an array and use JQuery to display it in 2 columns table.  But somehow it doesn't display into 2 columns as expected.</p>
  
  <p>I also have 2 text fields to enter a from date and a to date in order to filter the table, but some how it doesn't work.</p>
  
  <p>Please help.</p>
  
  <p>Here is <a href="http://jsfiddle.net/abcid/WWscZ/" rel="nofollow">live code</a></p>
  
  <p>HTML</p>
  
  <pre><code>&lt;p&gt;From:
    &lt;input class="datepicker" id="dateFrom" type="text"&gt;To:
    &lt;input class="datepicker" id="dateTo" type="text"&gt;
    &lt;button class="buttApply"&gt;APPLY&lt;/button&gt;
  &lt;/p&gt;
  
  &lt;div class="text"&gt;&lt;/div&gt;
  &lt;table id="myTable" border="1" width="300" cellpadding="5"&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>$(".datepicker").datepicker();
  
  
  $('.buttApply').click(
    function() {
      var filtered = dateList.filter(function(item) {
        return item &gt;= $('#dateFrom').val() &amp;&amp; item &lt;= $('#dateTo').val();
      });
  
      refreshTable(filtered);
  
  
    }
  );
  
  var dateList = [{
    name: "Mike Jenson",
    Date: "07/01/2014"
  }, {
    name: "Liz Vinal",
    Date: "07/02/2014"
  }, {
    name: "Robbin Jeson",
    Date: "07/03/2014"
  }, {
    name: "Allen Greene",
    Date: "07/04/2014"
  }, {
    name: "Dan Gray",
    Date: "07/05/2014"
  }, {
    name: "Jann Johnson",
    Date: "07/06/2014"
  }, {
    name: "Kelly Luther",
    Date: "07/07/2014"
  }, {
    name: "Rock Mule",
    Date: "07/08/2014"
  }, {
    name: "John Lenin",
    Date: "07/09/2014"
  }, {
    name: "Micheal Jenn",
    Date: "07/10/2014"
  }];
  
  function refreshTable(list) {
    $("#myTable")..append("&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Date&lt;/td&gt;&lt;/tr&gt;");
    for (var i = 0; i &lt; list.length; i++) {
      var tr = "&lt;tr&gt;";
      var td = "&lt;td&gt;" + list[i]["name"] + "&lt;/td&gt;";
      var td = "&lt;td&gt;" + list[i]["Date"] + "&lt;/td&gt;&lt;/tr&gt;";
      $('#myTable').append(tr + td + td);
    }
  }
  
  refreshTable(dateList);
  </code></pre>