title: Find the value of html table cell by passing column name for a particular row
body: <p>I am dynamically creating a table using JSON so i dont know in advance how many column and/or rows will be generated.</p>
  
  <p>I add a clicked event for the row that get selected.</p>
  
  <p>Now my every table will have a column name <strong>ID</strong></p>
  
  <p>I want to find the value of ID for the selected row.</p>
  
  <p>How can i achieve this?</p>
  
  <p>I have googled a find a lot of sample which select the cell be index but not by column name.</p>
  
  <p>My table is something like:</p>
  
  <p><img src="https://i.stack.imgur.com/6eL0C.jpg" alt="enter image description here"></p>
  
  <p>My table is generated like:</p>
  
  <pre><code>function CreateTableView(objArray, theme, enableHeader) {
  // set optional theme parameter
  if (theme === undefined) {
      theme = 'mediumTable'; //default theme
  }
  
  if (enableHeader === undefined) {
      enableHeader = true; //default enable headers
  }
  
  // If the returned data is an object do nothing, else try to parse
  var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
  
  var str = '&lt;table class="' + theme + '"&gt;';
  
  // table head
  if (enableHeader) {
      str += '&lt;thead&gt;&lt;tr&gt;';
      for (var index in array[0]) {
          str += '&lt;th scope="col"&gt;' + index + '&lt;/th&gt;';
      }
      str += '&lt;/tr&gt;&lt;/thead&gt;';
  }
  
  // table body
  str += '&lt;tbody&gt;';
  for (var i = 0; i &lt; array.length; i++) {
      str += (i % 2 == 0) ? '&lt;tr class="alt"&gt;' : '&lt;tr&gt;';
      for (var index in array[i]) {
          str += '&lt;td&gt;' + val(array[i][index]) + '&lt;/td&gt;';
      }
      str += '&lt;/tr&gt;';
  }
  str += '&lt;/tbody&gt;'
  str += '&lt;/table&gt;';
  return str;
  </code></pre>
  
  <p>}</p>
  
  <p>Any help is appreciated</p>