JSFiddle - React, Tailwind, and code Playground

by andig2

HTML

<table>
    <thead>
        <tr>
            <td>item</td>
            <td class="cost">cost</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>A</td>
            <td class="cost">1</td>
        </tr>
    </tbody>
</table

JavaScript

$('.cost').css({
    display: ($('tbody .cost').filter(function() {
        return ($(this).data('cost') || 0) > 0;
    }).get().length === 0) ? 'none' : null
});