By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,481 Members | 3,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,481 IT Pros & Developers. It's quick & easy.

Question related to <tbody> tag

P: 68
I wanted to know how to access a particular column of a table.

Suppose the table has the following columns.
Name University Age Grades

Now, I want to access the cells of the Age column.
I have this piece of code, but I'm not able to access the column i want to access.

Expand|Select|Wrap|Line Numbers
  1. function ShowLogs(opt, num)
  2.   {
  3.      var tab = document.getElementById('Table');
  4.      var numRows = tab.children.length;
  5.      var tabChild = tab.firstChild;
  7.      for (var i = 0; i < numRows; i++) {
  8. = '';
  9.          if (opt.value != 'All' && != opt.value) {
  10.     = 'none';
  11.          }
  12.          tabChild = tabChild.nextSibling;
  13.      }
  14.   }
the <tbody> definition is as follows

[HTML]<tbody id="Table">

<table border="1">


Can Any1 help me with this problem?


Feb 5 '08 #1
Share this Question
Share on Google+
1 Reply

P: 428
Move your tbody inside the table- a tbody is a collection of rows.
Feb 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.