473,397 Members | 2,056 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,397 software developers and data experts.

number of rows in a table

Hi, all

How do I get the number of rows in a table?

jack
Jul 23 '05 #1
2 22399
Jack,

Sorry I can't be more explicit, but this will point you in the right
direction. Using the JavaScript DOM model, you can assign the table(s)
you need to count rows for an id (for example, <table name="mytable",
id="table1">). Using DOM, you can directly access the table and count
the number of <td> tags that appear within. Obviously, each <td></td>
set is equivalent to 1 row.

-Mark

q2005 wrote:
Hi, all

How do I get the number of rows in a table?

jack


Jul 23 '05 #2
q2005 wrote:
Hi, all

How do I get the number of rows in a table?


Pass the id of the table to count the rows of. Get the rows
collection, then its length:

function numRows(t) {
if(document.getElementById) {
alert(document.getElementById(t).rows.length);
} else if (document.all) {
alert(document.all[t].rows.length);
}
}

--
Rob
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Roderik | last post by:
Hi, I have a table like this: <table id="myTable"> <tr><td>text</td><td>text</td></tr> <tr><td>text</td><td>text</td></tr> ... <tr><td>text</td><td>text</td></tr> </table>
0
by: John A Grandy | last post by:
In ASP.NET 2.0 , does the ObjectDataSource provide a method or property to return the number of rows returned ?
4
by: esmith2112 | last post by:
I have a situation that I can't explain. Boiled down to its essence, I have a query of the form SELECT A.COL1, A.COL2, B.COL1 FROM A LEFT JOIN B ON A.KEY = B.KEY This query produces 5383...
5
by: MN | last post by:
Hello, I have a customer table and another table that I need to prepopulate with special customer IDs, unique and not sequential. Is there a way to configure Access to assign the customer ID to...
1
by: sharadadutt1981 | last post by:
hi all, I was trying to fetch even or odd number rows from database. currently i am usying DB2 ver 8.0. any one can help me out.
7
imrosie
by: imrosie | last post by:
Hello, I'm trying to figure out how to store only the last 4 digits of a credit card number in a 'Payments' table. paymentid is the primary key, not credit card number. I tried using the...
13
by: Peader | last post by:
Hello, I’d like to make an inquiry into how to best perform a task in access 2003. I have a form which enters data into a table. This in turn is linked to a label. After ten data entries into the...
1
by: clickingwires | last post by:
How do you consecutively number rows in an aggregate query?
8
by: JVG | last post by:
hi, i am create complaint register in Ms- Access 2000 ther is i want complaint no. which is depend on month and year. for Eg. if the month is Janury and year is 2007 then my complaint number is...
1
by: jeddiki | last post by:
Hi, I want to get a subset from my table that includes rows that have an item (cb_id) with a unique ip address ( ip_adr). To be in the subset there should be at least two rows and if there are more...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.