473,799 Members | 3,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question related to <tbody> tag

68 New Member
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 1174
mrhoo
428 Contributor
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
23998
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 <div> Hide/Show work but not the divRow version? What I'm trying to do here is simultaneously hide 1 or more rows (possibly with nested divs as well). This would allow for an elegant an well performing base for an html base treetable (but I guess...
4
7280
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 this only gives me table rows with no table data cells. So I would like to know if it's possible to create several <TH> within the tHead row using this method?
34
11084
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 reason, there's an annoying vertical gap between adjacent rules that doesn't go away. This looks like IE6 is incorrectly setting the margin to some arbitrary value. Does anyone know if this is a known bug at MS? If you know of one, post the...
4
6596
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 scrolling data under fixed-position column headers aligned with the data columns. actually, the best solution posted was as described above, but it was found not to work in any known UA. i suspect it was an implementation problem and not an error...
0
1516
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 scrolling data under fixed-position column headers aligned with the data columns. actually, the best solution posted was as described above, but it was found not to work in any known UA. i suspect it was an implementation problem and not an error...
16
8376
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 -- each block contains three rows. this table is destined for paper printing. i would like to tell the browser *not* to bust up my blocks. rather, i would like it to smartly insert a page break inbetween <tbody>s if the last one cannot be rendered...
3
5367
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, Image imgAZ, Image imgZA) {
0
2014
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> section can anyone give me solution here is the code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
36
5120
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 do so, since this is not part of the specification. How then to you apply styles to entire columns? Surely you don't have to write <td class="behold"on every row item.
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9078
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.