<div id="scadenta" style="width:191px; overflow:hidden; border:1; height:90px;">
<table style="width:100%;">
<tr>
<td style="width:40%;"><input type="text"></input></td>
<td style="width:20%;"><input type="text"></input></td>
<td style="width:40%;"><input type="text"></input></td>
</tr>
</table>
</div>
This is a testing layout i use for one of my tables. It’s supposed to have 2 big columns hugging a smaller one. The problem is the tr and td sizes just don’t work. I get the all the TDs the same size and almost as large as the whole table. Is there something fundamentally wrong with my code or what else could be causing it to behave like this?
you’ll have to set a width for your’inputs, otherwise they’re set to the browsers default size. take a look at this jsfiddle-example with
style="width:90%;"set on the inputs (using 100% will make the inputs bigger than thetds because of the default-padding – see the box-model for more information about this).note that i also removed the closing
</input>-tags and made them empty elements (<input ... />) like it should be (but this has nothing to do wirth your question).