title: Finding if a content exists in a given column in a table, with Capybara or Xpath?
body: <p><em>Problem:</em> 
  Given a table, a specific piece of content should appear in the same column as a specific header. </p>
  
  <p><em>Clarification:</em>
  I can not test the column position numerically, or at least I can't hardcode it that way, since the number of columns can change based on various other conditions and I don't want to make my test that fragile.</p>
  
  <p><em>Example:</em></p>
  
  <pre><code>Name || Phone Number || Address
  ==============================================================
   ... || ...          || ...
   Joe || 555-787-7878 || 42 Nowhere Lane, Mulberry, California
   ... || ...          ||
  </code></pre>
  
  <p><em>With the code looking like so:</em></p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Phone Number&lt;/th&gt;
      &lt;th&gt;Registered&lt;/th&gt;
      &lt;th&gt;Address&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      ...
    &lt;/tr&gt;
  
    &lt;tr&gt;
      &lt;td&gt;Joe&lt;/td&gt;
      &lt;td&gt;555-377-7347&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
      &lt;td&gt;42 Nowhere Lane1, Mulberry1, California&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Jerry&lt;/td&gt;
      &lt;td&gt;555-787-7878&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
      &lt;td&gt;50 Nowhere Lane, Mulberry, California&lt;/td&gt;
    &lt;/tr&gt;
  
    &lt;tr&gt;
      &lt;td&gt;Tom&lt;/td&gt;
      &lt;td&gt;555-678-0987&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
      &lt;td&gt;43 Nowhere Lane2, Mulberry2, California&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      ...
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><em>Scenario:</em>
  I want to insure the correct address (42 Nowhere...) appears in the column with the header "Address".</p>
  
  <p>How can I do this?</p>
  
  <p>The solution might be as simple as a decent xpath query, to be honest, perhaps I don't even need anything particularly "Capybara" related!</p>
  
  <p>I came across similar one, but here I need to check whether 'Jerry' registered or not. Please help me how can i automate using ruby/capybara</p>
  
  <p>Thanks in Advance</p>