Get count of rows in each table while having more than 1 tables
- by sneha khan
I have more then one tables on same page and want to add a line show count of each table as below.
I tried something but it gives sum of count of all table rows.
<table>
<tr>
<td>Some data</td>
<td>More data</td>
</tr>
<tr>
<td>Some data</td>
<td>More data</td>
</tr>
</table>
<table>
<tr>
<td>Some data</td>
<td>More data</td>
</tr>
<tr>
<td>Some data</td>
<td>More data</td>
</tr>
</table>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$().ready(function(){
//I want to add a line after each table showing each table row count
$("table").after(??? + " rows found.");
});
</script>