DelphiFAQ Home Search:
General :: Web publishing :: JavaScript :: Document


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Obtain the number of rows in a table


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

Generated 0:01:35 on Dec 6, 2019