This part allows you to get the data of the row in which the data has been selected
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <div id="here"></div>
  <table style="width:100%" id="table">
  <tr>
    <td><input class="checkMe" type="checkbox" />        </td>
    <td>Jill</td>
    <td>Smith</td> 
    <td>4350</td>
  </tr>
  <tr>
    <td><input class="checkMe" type="checkbox" />        </td>
    <td>Mark</td>
    <td>Kllis</td> 
    <td>5110</td>
  </tr>
  <tr>
    <td><input class="checkMe" type="checkbox" />        </td>
    <td>Keath</td>
    <td>Marks</td> 
    <td>53210</td>
  </tr>
    </table>
  <button onclick="myFunction()">Click me</button>
  <script>
    function myFunction(){
      var checks = document.getElementsByClassName('checkMe');
      var table = document.getElementById('table')
      var element = document.getElementById("here");
      while (element.firstChild) {
        element.removeChild(element.firstChild);
      }
      for (var i = 0; i < table.rows.length; i++) {
        if(checks.item(i).checked == true){
          var fName = table.rows[i].cells[1].innerHTML; //first column  
          var lName = table.rows[i].cells[2].innerHTML; //first column  
          var num = table.rows[i].cells[3].innerHTML; //first column  
          var para = document.createElement("p");
          var node = document.createTextNode(fName + " " + lName + " "  + num);
          para.appendChild(node);
          element.appendChild(para); 
        }
      }
    }
  </script>
</body>
</html>
For writing into to CSV there is already a great answer HERE and he made a cool code on fiddle which you can take a look at HERE