aspx Tutorial

NET Articles,jQuery demo, with jQuery, online tutorial,Jquery, SilverLight, Javascript,,JSON, MVC,.NET Articles,demo, Web Services,
Advertise Here


Get our toolbar!


Posted by Aamir Hasan   on Tuesday, December 21, 2010 Total Views:  

In this example, i have told you that how can we count the number of row(s) in a table using jQuery. This is very simple using jQuery,

Here’s is an example

<head runat="server">
   <title>Get no. of rows in a Table using jQuery</title>
   <script src="" type="text/javascript"></script>
   <script type="text/javascript">
       $(document).ready(function () {
           CountRow = function (T) {
               return $(T + " tr").length;

           $("#msg").text("Total row(s): " + CountRow("#table1"));
   <style type="text/css">
           font-family: Verdana;
           font-size: 11px;
           width: 400px;
           width: 25px;
           border-bottom: 1px solid #eaeaea;
           padding-left: 10px;
           border-top: 1px solid #eaeaea;
           border-bottom: 1px solid #eaeaea;
   <form id="form1" runat="server">
       <table id="table1" cellpadding="0" cellspacing="0">
                   Full Name
               <td>Aamir Hasan</td>
               <td>Awais Ahmed</td>
               <td>Saba Hasan</td>
   <div id="msg">&nbsp;    </div>


Display Table Rows (1.25 kb)

Live demo

Protected by Copyscape Online Plagiarism Tool

Add comment

  Country flag

  • Comment
  • Preview

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5