Only count <th>s on the current <tr>

To determine the column to sort, algorithm was summing 'colspan' values of all <th>s in the table, up to the one with the same index as the clicked <th>.

However, it should only have been examining the 'colspan' values of the <th>s in the <tr> of the clicked <th>.

Gets the first ancestor <tr> ('closest("tr")') and examines its elements instead of the whole table.