title: Get table row index and row data in TypeScript
body: <p>I have a table in HTML, which is created as follows:</p>
  
  <pre><code>&lt;table id="tableID" onclick="getRowData()" class="table table-hover"&gt;&lt;/table&gt;
  </code></pre>
  
  <p>At first it gets populated with some initial data, which could make it look something like this: </p>
  
  <pre><code>From  Action  To
   a      1     b
   a      0     a
  </code></pre>
  
  <p>I want to be able to retrieve the data from an arbitrary row, just by clicking on that row on the webpage. I also want to be able to retrieve the row index from that row as well. For example, if I would want to get the data from the first row, then I would get <code>a 1 b</code> </p>
  
  <p>How would such a function look like? </p>