title: How to create resuable methods for Tables in Selenium Webdriver
body: <p>I need to work with tables by using reusable method for different table. We have two different types of tables as below</p>
  
  <pre><code>    &lt;div id="grid"&gt;
      &lt;div class="header"&gt;
      &lt;table&gt;
      &lt;thead&gt;
      &lt;tr&gt;
      &lt;tr&gt;
  
  &lt;div id="grid"&gt;
  &lt;div class="header"&gt;
  &lt;table&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
  </code></pre>
  
  <p>how can i write a common method for these two.</p>
  
  <p>i would like to have some thing like..</p>
  
  <p>//div[@id='Grid']/div/table/tbody or thead.</p>
  
  <p>i would like to just pass the table id like</p>
  
  <p>//div[@id='"+tableId+"']/div/table/tbody or thead</p>