Answer: Write below code:-
var table_row_count = $('#html_table_id tr').length;
For Example:-
Suppose,i have an HTML table which contains 4 <tr> i.e. rows as below:-
<table id = "html_table_id" style = "border-color:yellow;">
<tr><td>DOT NET FUNDA.COM ROW1</td></tr>
<tr><td>DOT NET FUNDA.COM ROW2</td></tr>
<tr><td>DOT NET FUNDA.COM ROW3</td></tr>
<tr><td>DOT NET FUNDA.COM ROW4</td></tr>
</table>
Asked In: Many Interviews |
Alert Moderator