DelphiFAQ Home Search:

Obtain the number of rows in a table


comments45 comments. Current rating: 4 stars (15 votes). Leave comments and/ or rate it.


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


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.');

Content-type: text/html


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
2020-06-23, 21:56:19
Walker from United States  
Pretty! This was an incredibly wonderful article. Thank you for supplying this info.
2020-07-02, 06:22:51
clomiphene citrate tablets
2020-07-06, 13:25:45
sildenafil coupons walmart
2020-07-07, 01:58:40
Chas from United Kingdom  
generic cialis cheap
2020-07-07, 15:24:59
Dominick from Greece  
tylenol pm for sale
2020-07-08, 18:59:00
ventolin hfa inhaler generic
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: