jquery Operation Table Summary

Source: Internet
Author: User
Returns the index of a table row or column TD is a column, TR is a row: <script type= "Text/javascript" >$ (document). Ready (function () {$ ("table TD"). BIND ("click" , function () {var index = $ (this). Parent (). index (); alert (index);//indicates the index of the row in which it is located. If you want the index of the column, remove the parent ()}); </script> returns closest the nearest table element of the specified element, var tableId = $ (' input[class= "Daobubili"] "). Closest (" table "). attr (" id "); Get the table index (); jquery finds the TD column for the specified table $ ("#tab tr"). Find ("Td:eq (7)"); Special form template Remember to set thead so that traversing tbody  TR will not have a header line. <table>      <thead>        <tr>          <th style= "Display:none" > Hide </th>          <th width = "5%" > Serial number </th>                   </tr>        </thead>          <tbody>               <tr moban  style= "Height : 33px;display:none ">                              </tr>        <tbody></table>

  

jquery Operation Table Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.