I am using the tablesorter javascript plugin to easily sort a bootstrap 3 table. My current code is simply:
$(document).ready(function() {
$('.table').tablesorter();
});
My problem arises with columns that have no data but font awesome icons in, the check and the cross.
<i class="fa fa-check"></i>
<i class="fa fa-times"></i>
Because there is no physical text in these columns, I am unable to sort them.
Aside of writing Yes and No beside the icon, is there any workaround to get tablesorter looking at HTML code instead of just text?
<span>tag next to your icons and just hide the tag, like this:<span style="display: none;">Yes</span>and see if it will sort on that.textExtractionfunction to extract out the class names. This example extracts the id.