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 to display number of column(s) in a table using jQuery. This is very simple using jQuery,

Here’s is an example

<html xmlns="">
<head runat="server">
   <title>Display number of column(s) in a Table using jQuery</title>
   <script src="" type="text/javascript"></script>
   <script type="text/javascript">
       $(document).ready(function () {
           CountColumn = function (T) {
               return $(T).find('tr')[0].cells.length;

           $("#msg").text("Total column(s): " + CountColumn("#table1"));
   <style type="text/css">
           font-family: Verdana;
           font-size: 12px;
           width: 500px;
           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">
   <h2>Display length of column(s) in a Table using jQuery</h2>
       <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>


Table column (1.30 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