JSFiddle - React, Tailwind, and code Playground

HTML

<table>
            <thead>
                <tr>
                    <th>Product</th>
                </tr>
            </thead>
            <tbody>
                <tr><td>1</td></tr>
                <tr><td>2</td></tr>
                <tr><td>3</td></tr>
                <tr><td>4</td></tr>
            </tbody>
        </table>

CSS

tr:first-of-type, tr:last-of-type{
                background-color: red;
            }