Home > Web Front-end > JS Tutorial > Code for dynamically deleting rows and columns of Table based on JQuery_jquery

Code for dynamically deleting rows and columns of Table based on JQuery_jquery

WBOY
Release: 2016-05-16 18:06:56
Original
1250 people have browsed it

First, I need to get the number of rows in the Table. I add the table through the background, so when I get it in the front desk, I get the total number of assignments by length
For example, in the picture above:
If I want to print this table but don’t want to operate it What to do with the contents of that column?

Copy code The code is as follows:

for(var i=0;i{
 $("table tr").eq(i).find("td").eq(0).remove();
}

Explanation:
Num is the list sum obtained from the background. 1 is also removed for the header.
The first eq(i) is to get the TR index in the Table
The second eq(0) is to get the first TD position in the TR
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template