Hello.
I came to issue with tables when was trying to use selectors at <td> tags when have rowspan and colspan. There is no way to do correct and flexible selection. For example I have a table:
- <table>
- <tr>
- <td rowspan="2">Element 1</td>
- <td>Element 2</td>
- <td>Element 3</td>
- </tr>
- <tr>
- <td>More element 2</td>
- <td>More element 3</td>
- </tr>
- </table>
In this situation, I have a table with rowspan and trying to do selection:
- $("tr").each( function() {
- $("td:first", this).addClass("first");
- });
And getting this result:
- <table>
- <tr>
- <td rowspan="2" class="first">Element 1</td>
- <td>Element 2</td>
- <td>Element 3</td>
- </tr>
- <tr>
- <td class="first" >More element 2</td>
- <td>More element 3</td>
- </tr>
- </table>
Is there any way to have jQuery to be more smart in similar situations with tables and rowspan/colspan selecting process? For example, to use some kind flag to do needed selection?
Thank you very much in advance!
Regards,
Max