JSFiddle - React, Tailwind, and code Playground

HTML

The first tbody will prevail:
<table>
    <tbody class="blu"><tr><td>somedata</td></tr></tbody>
    <tbody class="off"><tr><td>somedata</td></tr></tbody>
    <tbody class="gre"><tr><td>somedata</td></tr></tbody>
</table>

The second tbody will prevail:
<table>
    <tbody class="off"><tr><td>somedata2</td></tr></tbody>
    <tbody class="gre"><tr><td>somedata2</td></tr></tbody>
    <tbody class="blu"><tr><td>somedata2</td></tr></tbody>
</table>

CSS

.off { color: red }
.blu { color: blue }
.gre { color: green }

JavaScript

var seen = {};
$('tbody').each(function() {
    var elmt = {txt: $(this).text(), ref: this};
    if (seen[elmt.txt]) { // text already exists
        if ($(seen[elmt.txt].ref).hasClass('off')) {
            $(seen[elmt.txt].ref).remove();
            seen[elmt.txt].ref = this;
        } else {
            $(this).remove();
        }
    }
    else
        seen[elmt.txt] = elmt;
});