DelphiFAQ Home Search:

Obtain the number of rows in a table

 

comments39 comments. Current rating: 5 stars (9 votes). Leave comments and/ or rate it.

Question:

How can I obtain the number of rows in an HTML table using javascript?

Answer:

The following code assumes that your table has the ID 'MyTable'

<script language="JavaScript">
<!--
var oRows = document.getElementById('MyTable').getElementsByTagName('tr');
var iRowCount = oRows.length;

alert('Your table has ' + iRowCount + ' rows.');
//-->
</script>

Content-type: text/html

Comments:

You are on page 3 of 3, other pages: 1 2 [3]
2014-07-13, 07:40:20
anonymous from Malaysia  
Rahim Suboh
Account No 104068242480
2014-07-13, 07:41:45
anonymous from Malaysia  
RAHIM SUBOH
BANK ACCOUNT 104068242480
2014-07-13, 07:43:07
anonymous from Malaysia  
RAHIM SUBOH
ACCOUNT NO 104068242480
2014-07-13, 07:44:21
anonymous from Malaysia  
RAHIM SUBOH
ACCOUNT NO 104068242480
2014-07-13, 07:45:41
anonymous from Malaysia  
RAHIM SUBOH
BANK ACCOUNT 104068242480
2014-07-13, 07:47:24
anonymous from Malaysia  
RAHIM SUBOH
ACCOUNT NO 104068242480
2014-07-13, 07:48:31
anonymous from Malaysia  
RAHIM SUBOH
ACCOUNT 104068242480
2015-01-30, 00:40:07
anonymous from Budapest, Hungary  
Bro Mani - Klang Chapter 说道:Well done Tzu Chi volunteers! Keep up the good work of colannutily helping the poor and the needy. God bless our Dharma Master Cheng Yen.
2015-11-03, 06:38:32
anonymous from India  
rating
You are on page 3 of 3, other pages: 1 2 [3]

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: