Identify and add style class for specific column with duplicated values
Identify and add style class for specific column with duplicated values

Hi, I am not sure if this question been asked before but I couldn't find exact answer for what I need.
I am working with a subscription system where we will giving out FREE voucher to subscriber, but we found out there's many subscribers are under the same IP address. We don't mind to collect those data but i would like to highlight the specific row when duplicate data found something like:
<tr class="duplicateclass">
<td>Aaron</td>
<td>192.111.111.111</td>
</tr>
<tr class="">
<td>Becky</td>
<td>111.222.222.111</td>
</tr>
<tr class="duplicateclass">
<td>Catherine</td>
<td>192.111.111.111</td>
</tr>
then underneath the table, it shall display something like:
192.111.111.111 : Repeat 2 times
which easier for me to search them out.
Any ideas??
Answers
You could get the data with
column().data()
and usesort()
- so something likeIterate through, and if the current value is the same as the previous, flag it,
Colin