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
- <body>
- <table class="table1">
- <tbody>
- <tr class="headers">
- <th>header1</th>
- <th>header2</th>
- </tr>
- <tr><td>data1</td><td>data2</td></tr>
- <tr><td>data3</td><td>data4</td></tr>
- <tr><td>data5</td><td>data6</td></tr>
- </tbody>
- </table>
- <table class="table1">
- <tbody>
- <tr class="headers">
- <th>header3</th>
- <th>header4</th>
- </tr>
- <tr><td>data11</td><td>data22</td></tr>
- <tr><td>data33</td><td>data44</td></tr>
- <tr><td>data5</td><td>data6</td></tr>
- </tbody>
- </table>
- </body>
Thanks
David.