- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to count number of rows in a table with jQuery?
Example
<html> <head> <title>table</title> <style type="text/css"> table,th,td { border:2px solid black; margin-left:400px; } h2 { margin-left:400px; } button { margin-left:400px; } </style> <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("button").click(function () { var rowcount = $('table tr').length; alert("No. Of Rows ::" +rowcount); }); }); </script> </head> <body> <div> <h2>HTML TABLE</h2> <table> <tr> <th> NAME </th> <th> AGE </th> </tr> <tr> <td>DD</td> <td>35</td> </tr> <tr> <td>SB</td> <td>35</td> </tr> <tr> <td>AD</td> <td>5</td> </tr> <tr> <td>AA</td> <td>5</td> </tr> </table> <button type="button" id="btn">Click Here</button> </div> </body> </html>
- Related Articles
- How to count number of columns in a table with jQuery
- How to count the number of rows in a table in Selenium with python?
- How to count number of Rows and Column using jQuery
- How to Count the Number of Rows in a MySQL Table in Python?
- Fastest way to count number of rows in MySQL table?
- How to get number of rows in a table without using count(*) MySQL query?
- Count number of rows in each table in MySQL?
- How to hide table rows containing zero value with jQuery?
- How can we use MySQL SELECT statement to count number of rows in a table?
- How to select all even/odd rows in a table using jQuery?
- Count rows having three or more rows with a certain value in a MySQL table
- Get the number of rows in a particular table with MySQL
- Count number of rows in a MongoDB collection
- MySQL - How to count all rows per table in one query?
- Count the number of columns in a MySQL table with Java

Advertisements