JSFiddle - React, Tailwind, and code Playground

by thornomad

HTML

<table>
    <tr>
        <td><p>some text</p></td>
        <td><p>some text</p></td>
        <td><p id="hide">hide it</p></td>
        <td><p>hide it</p></td>
        <td><p>hide it</p></td>
        <td><p>hide it</p></td>
        <td><p>hide it</p></td>
        <td><p>hide it</p></td>
        <td><p>hide it</p></td>          
        <td><p>some text</p></td>
        <td><p>some text</p></td> 
    </tr>
</table>

CSS

td { padding: 10px; }

JavaScript

// the chosen solution that works for me, thanks
$("#hide").closest("td").nextAll().andSelf().slice(0, 7).hide();