473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Question related to <tbody> tag

Hi,
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;
  6.  
  7.      for (var i = 0; i < numRows; i++) {
  8.          tabChild.style.display = '';
  9.          if (opt.value != 'All' && tabChild.id != opt.value) {
  10.              tabChild.style.display = 'none';
  11.          }
  12.          tabChild = tabChild.nextSibling;
  13.      }
  14.   }
  15.  
the <tbody> definition is as follows


[HTML]<tbody id="Table">

<table border="1">
<tr>
<td>Name</td><td>Uni</td><td>Age</td><td>Grades</td>
</tr>
<tr>
<td>A</td>
<td>DSFSDF</td>
<td>45</td>
<td>SDFSD</td>
</tr>
<tr>
<td>B</td>
<td>DSFSDF</td>
<td>23</td>
<td>SDFSD</td>
</tr>

</table>
</tbody>
[/HTML]

Can Any1 help me with this problem?


Thanks,


Ravi
Feb 5 '08 #1
1 1136
mrhoo
428 256MB
Move your tbody inside the table- a tbody is a collection of rows.
Feb 5 '08 #2

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

Similar topics

8
by: F. Da Costa | last post by:
Following is a snippet of html in which I hide a whole table and try to hide a single row. Here is my question (plz don't chew my head off if its css related instead): Why does the divTable...
4
by: El Diablo | last post by:
Hi there, I'm trying dynamically generate extra rows in a table. So far this achieves this task within the tHead segment: theTable.tHead.appendChild(document.createElement('TR')) ....but...
34
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
4
by: None | last post by:
i checked the archives of this group and found that, so far, no-one has posted a working css solution to making a <tbody> block scrollable, using the overflow property. the purpose is to create...
0
by: Dave Mausner | last post by:
i checked the archives of this group and found that, so far, no-one has posted a working css solution to making a <tbody> block scrollable, using the overflow property. the purpose is to create...
16
by: matt | last post by:
hello, ive been trying to figure something out, largely thru trial & error. thought perhaps someone else may have knowledge. i have an html table that consists of blocks of related data --...
3
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, How I generate <tbodytag using Table, TableRow, etc ... controls ? I have this method: private Table GenerarTablaOrdenacion(LinkButton lnkAscendente, LinkButton lnkDescendente,...
0
by: pravinnweb | last post by:
Hi, i have one table with <thead>,<tbody> and <tfooter> i have applying the overflow property for <tbody> section in firefox its working fine.but in IE6 the <thead> section is coming in the <tbody>...
36
by: Roedy Green | last post by:
The only browser I have encountered that supports <colgroup><col class="behold"></colgroup> to apply a CSS style to a whole column, is Microsoft Internet Explorer. I have been told it SHOULD NOT...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.