Implementation of inserting a row at a specified position in the Javascript talbe table

Source: Internet
Author: User

Recently I learned Javascript. The following is an example (based on w3cschool)
In this example, a row is inserted after the row clicked by the mouse. By default, a row is inserted in the first row. You can enter the inserted content by yourself, CodeAs follows: <Br/> <Table id = "mytable" border = "1"> <tr> <TD> row1 cell1 </TD> <TD> row1 cell2 </TD>/ tr> <TD> row2 cell1 </TD> <TD> row2 cell2 </TD> </tr> <TD> row3 cell1 </TD> <TD> row3 cell2 </TD> </tr> </table> <p> cell1: <input type = "text" id = "cell1" value = "cell1" <br/> cell2: <input type = "text" id = "cell2" value = "cell2"> </P> <p> <input type = "button" onclick = "insrow () "value =" insert row ">
Related Article

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.