Selecting tr td elements in a table based on the hr element

Selecting tr td elements in a table based on the hr element

I'm trying to select tr td elements so I can use each to loop though. I have multiple tables in the document that don't have a way to be identified other than using the tr th information.

Example - I'm trying the select all the tr td elements where th = header1


  1. <body>
  2. <table class="table1">
  3.        <tbody>
  4.              <tr class="headers">
  5.                     <th>header1</th>
  6.                    <th>header2</th>
  7.              </tr>

  8.              <tr><td>data1</td><td>data2</td></tr>
  9.               <tr><td>data3</td><td>data4</td></tr>
  10.              <tr><td>data5</td><td>data6</td></tr>
  11.        </tbody>
  12. </table>

  13. <table class="table1">
  14.        <tbody>
  15.              <tr class="headers">
  16.                      <th>header3</th>
  17.                     <th>header4</th>
  18.              </tr>

  19.              <tr><td>data11</td><td>data22</td></tr>
  20.              <tr><td>data33</td><td>data44</td></tr>
  21.              <tr><td>data5</td><td>data6</td></tr>
  22.        </tbody>
  23. </table>
  24. </body>

I've setup a jsFiddle project  to highlight the problem.  http://jsfiddle.net/wGPJ8/4/

Thanks

David.