DelphiFAQ Home Search:

Obtain the number of rows in a table

 

comments49 comments. Current rating: 4 stars (19 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>

Comments:

You are on page 3 of 4, other pages: 1 2 [3] 4
2014-07-13, 07:40:20
anonymous from Malaysia  
Rahim Suboh
Account No 104068242480
2020-06-23, 21:56:19
Walker from United States  
rating
Pretty! This was an incredibly wonderful article. Thank you for supplying this info.
2020-07-02, 06:22:51
Erwin  
rating
clomiphene citrate tablets
2020-07-06, 13:25:45
Gus  
rating
sildenafil coupons walmart
2020-07-07, 01:58:40
Chas from United Kingdom  
rating
generic cialis cheap
2020-07-07, 15:24:59
Dominick from Greece  
rating
tylenol pm for sale
2020-07-08, 18:59:00
Fredric  
rating
ventolin hfa inhaler generic
You are on page 3 of 4, other pages: 1 2 [3] 4

 

 

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: