JSFiddle - React, Tailwind, and code Playground

HTML

This table should have just one column:

<table style="width: 100%;">
    <tr>
        <td>x</td>
    </tr>
    <tr>
        <td>x</td>
    </tr>
</table>

CSS

td {
    background-color: lightgray;
}

JavaScript

var cells = $("td");

// first row -> works as expected
cells[0].style.display = "none";
cells[0].style.display = "table-cell";

// second row -> width() on hidden cell shifts it to the right
cells[1].style.display = "none";
$(cells[1]).width();
cells[1].style.display = "table-cell";