title: Export html table with dropdown lists to a CSV file using jquery/javascript
body: <p>As written in the title , I have HTML table that has few columns where the user has to select values from dropdown lists. What I want to do is to be able to export this table to a CSV file . I found online a jquery plugin but I have a problem with the dropdown lists. It gives back all of the option for each row instead the ones that are selected. I tried fixing this but I failed. </p>
  
  <p>The JQuery plugin and and example table are in the jsfiddle:</p>
  
  <p><a href="https://jsfiddle.net/bLa8pn74/" rel="noreferrer">https://jsfiddle.net/bLa8pn74/</a></p>
  
  <p>I tried to insert this: </p>
  
  <pre><code>if($(this).find('select').each(function(){
                      line.push(_quote_text($(this).find("option:selected").text()));
                  }));
  </code></pre>
  
  <p>But it only printed the head row. I now it should be simple change but I just can't figure it out .</p>
  
  <p>EDIT: I would like that my solution is without creating new table.</p>
  
  <p><strong>EDIT 2</strong>: I tried this code also :</p>
  
  <pre><code>if($(this).find('select')){
      line.push(_quote_text($(this).find('option:selected').text()));
              }
      line.push(_quote_text(_trim_text($(this).text())));
  </code></pre>
  
  <p>And it gives me the selected option but also afterwards all dropdown options, and extra "","", where it finds an empty cell.</p>
  
  <p>And If I add "else" before the second "line.push" then it returns only the selected values and everything else is empty.</p>