JSFiddle - React, Tailwind, and code Playground
HTML
<p>Resize the window and see how the values change.</p>
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
CSS
table {
border-collapse: collapse;
}
td {
width: 200px;
height: 32px;
border: 1px solid black;
}
JavaScript
function updateWidth() {
$("td").each(function (index, element) {
$(this).text($(this).get(0).getBoundingClientRect().width);
});
}
updateWidth();
$(window).resize(function() {
updateWidth();
});