JSFiddle - React, Tailwind, and code Playground

HTML

<table id = "myTable">
        <thead>
            <tr>
                <th>
                     Name
                </th>
                <th>
                    Address
                </th>
        <th>
                    Age
                </th>
            </tr>
        </thead>
        <tr>
            <td>
                Lijo
            </td>
            <td>
                India
            </td>
        <td>
                27
            </td>
        </tr>
    </table>

JavaScript

$("#myTable th, #myTable td").each(function (i) {
    $(this).css('background-color', ['red', 'yellow', 'blue'][i % 3]);
});