JSFiddle - React, Tailwind, and code Playground

by nate

HTML

<table>
    <tr>
        <th>header</th>
        <th>header</th>
        <th>header</th>
        <th>header</th>
        <th>header</th>
    </tr>
    <tr>
        <td>data</td>
        <td>data</td>
        <td>data</td>
        <td>data</td>
        <td>data</td>
    </tr>
</table>

JavaScript

var $table = $('table');

// One way
//$table.find('th:nth-last-child(-n+2), td:nth-last-child(-n+2)').hide('slow');

// Another way
$table.find('th').slice(-2).add(
    $table.find('td').slice(-2)
).hide('slow');