JSFiddle - React, Tailwind, and code Playground

HTML

<table class="table1">
    <tr class="row1">
        <td class='cell11'>1-1</td>
        <td>1-2</td>
        <td>1-3</td>
    </tr>
    <tr class="row2">
        <td class='cell21'>2-1</td>
        <td>2-2</td>
        <td>2-3</td>
    </tr>
    <tr class="row3">
        <td class='cell31'>3-1</td>
        <td>3-2</td>
        <td>3-3</td>
    </tr>
</table>

CSS

table {
    border: 1px solid black;
    background-color: white;
}

 .colorRows {
    background-color: yellow;
}

JavaScript

$('.row1').addClass("colorRows");
$(".cell31").closest("tr").addClass("colorRows");