Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table>
- <tr>
- <td colspan="2" id="First">
- </td>
- <td colspan="2" id="Second">
- </td>
- </tr>
- </table>
- var index = 0;
- $("#Second").prevAll("td").each(function() {
- index += this.colSpan;
- });
- console.log(index);
- <table>
- <tr>
- <td>One column wide</td>
- <td colspan="2">Two columns wide</td>
- <td>One column wide</td>
- <td colspan="2" id="Last">Two columns wide</td>
- </tr>
- </table>
- <table>
- <tr>
- <td>One column wide</td>
- <td colspan="2">Two columns wide</td>
- <td>One column wide</td>
- <td colspan="2" id="Last">Two columns wide</td>
- </tr>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement