How can we count number of rows in a table using jQuery

AuthorHariom Prajapati

Pubish Date19 Jun 2022


In this tutorial we will see that how to count number of rows in a table using jQuery .lenght property.

let's see the example to count number of row present in a table using jQuery.


Count number of row in a table

<!DOCTYPE html>
<html lang="en">

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src=""></script>
    <title>Count number of row in table using jQuery</title>

    <table id="DemoTable">
    <button type="button" class="button">Get Total no of rows</button>

        $('.button').click(function () {
            var TotalRows = $('#DemoTable tr').length;





Comments 0

Leave a comment