Hello all,
Is there any way that I can count the number of lines in one column in a table? Such as I want to count all the names in this column on First name:
http://www.globalvirtualairlines.com/MyPages/web%20app.php

How would I do so?
Thanks in advance! :)

Hello all,
Is there any way that I can count the number of lines in one column in a table? Such as I want to count all the names in this column on First name:
http://www.globalvirtualairlines.com/MyPages/web%20app.php

How would I do so?
Thanks in advance! :)

Are you counting rows or columns? Either way, you might want to use PHP.

Count rows:

substr_count($table, '<tr>');

Count columns:

$row = preg_replace('/.*\<\tr>(.*?)\<\/tr>.*/','$1',$table);
substr_count($row, '<td>');

Could also use jquery

$('#tableID tr').size()
or
$('#tableID tr').length()
or
$('#tableID tr').count()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.