I’m using a pretty simple table layout for a tabular UI, where the user will fill out various properties.
Every cell contains a text label for the property, and an input
element.
In the case where there’s additional space remaining in the table cell, I’d like the input
element to grow to fill that space.
In the snippet below, I’m asking how I style the input
for Occupation to take the remaining width in it’s cell:
<code>table, td {
border: solid black;
border-collapse: collapse;
padding: 3px;
}</code>
<code>table, td {
border: solid black;
border-collapse: collapse;
padding: 3px;
}</code>
table, td {
border: solid black;
border-collapse: collapse;
padding: 3px;
}
<code><table>
<tr>
<td>
First Name: <input/>
</td>
<td>
Last Name: <input/>
</td>
</tr>
<tr>
<td colspan="2">
Occupation: <input/>
</td>
</tr>
</table></code>
<code><table>
<tr>
<td>
First Name: <input/>
</td>
<td>
Last Name: <input/>
</td>
</tr>
<tr>
<td colspan="2">
Occupation: <input/>
</td>
</tr>
</table></code>
<table>
<tr>
<td>
First Name: <input/>
</td>
<td>
Last Name: <input/>
</td>
</tr>
<tr>
<td colspan="2">
Occupation: <input/>
</td>
</tr>
</table>