title: jQuery if table has more than 2 td in a row with 2 conditions
body: <p>I am trying to combine 2 conditions in an "if" statement if possible. </p>
  
  <p>I want to first check the screen width and then see if there are more than 2 td's in a row or first row of a table. If there is do some function.</p>
  
  <p>This is what I have as my first part for the width but how would I add in the other condition that needs to be met?</p>
  
  <pre><code>var width = parseInt($(window).width());
  if (width&lt;=610) {  
  //Need to add the other condition that is a table has more than 2 td's in a row
  
  }
  </code></pre>
  
  <p>Here is the real code I am trying to run. See my comment for executing if more than 2 columns.</p>
  
  <pre><code>var width = parseInt($(window).width());
  if (width&lt;=610) {   
  
      //Need to figure out how execute this if there are more than 2 columns in the table???
      $('.content table').replaceWith(function() {
  
      var $th = $(this).find('th'); // get headers
      var th = $th.map(function() {
          return $(this).text();
      }).get(); // and their values
  
      $th.closest('tr').remove(); // then remove them
  
      var $d = $('&lt;div&gt;', { 'class': 'responsive-table' });
  
      $('tr', this).each(function(i, el) {
          var $div = $('&lt;div&gt;', {'class': 'box grey-bg'}).appendTo($d);
          $('td', this).each(function(j, el) {
              var n = j + 1;
              var $row = $('&lt;div&gt;', {
                  //'class': 'row-' + n
                  'class': 'row'
              });
              $row.append(
              $('&lt;span&gt;', {
                  //'class': 'label-' + n,
                  'class': 'label',
                  text: th[j]
              }), ' : ', $('&lt;span&gt;', {
                  //'class': 'data-' + n,
                  'class': 'data',
                  text: $(this).text()
              })).appendTo($div);
          });
      });
      return $d;  
      }); 
  
  };
  </code></pre>