I've searched and there's a few posts online from a few years ago saying this isn't possible. It might be now though. I just need this to work on modern browsers. FF, Chrome, IE11. This currently works on Firefox and Chrome, but not on IE11.
http://jsfiddle.net/predbjax/18/
Basically the height of the input box should be equal to the height of the table cell. (The magenta should cover all the yellow). In chrome this can be done by adding height: 100% to the input css. This doesn't work though in Firefox. One solution is to set a fixed height for the table row, but that's not ideal.
<table>
<tr>
<td>Large text</td>
<td><input type="text" value="test"></td>
</tr>
</table>
and the css:
* { margin: 0; padding: 0; }
table
{
border-spacing: 0;
}
table td:first-child
{
font-size: 50px;
background-color: #f00;
}
table td:last-child
{
position:relative;
background-color: #ff0;
}
input
{
background-color: #f0f;
border: none;
position:absolute;
height: 100%;
top: 0;
}