JSFiddle - React, Tailwind, and code Playground

HTML

<table style="position: absolute;">
    <tr class="test-row">
        <td>Name1</td>
        <td class="test-cell">
            <input type="text" value='test1'/></td>
    </tr>
    <tr class="test-row">
        <td>Name2Name2<br/>Name2Name2<br/>Name2Name2<br/>Name2Name2</td>
        <td class="test-cell"><input type="text" value='test2test2'/></td>
    </tr>
</table>

CSS

table
{
    border-collapse:collapse;
}

td
{
    padding:0;
    border: 1px Solid gray;
    height: 20px;
    width: 100px;
}

.test-row 
{
    background-color: red;
}

.test-cell div, .test-cell input
{
    height:100%;
    width:auto;
    background-color: green;
}

JavaScript

$("td").each(function () {
    var cell = $(this);
    cell.css('height', cell.height() + 'px');
});