Input Text Box And Width 100%
I'm writing a simple form for sending some data to a database. I use it in my own company so I don't need to have a perfect style. I am using a table for the layout (this is okay i
Solution 1:
table {
border:1px solid black;
width: 200px;
}
.left {
float: left;
}
.left2 {
overflow: hidden;
padding: 04px;
}
.left2>input {
width: 100%
}
<table><tr><td><labelclass="left">Born</label><divclass="left2"><inputtype="text"name="nato_pf" /></div></td></tr></table>
Solution 2:
<tablewidth="500px"style="border: 1px solid black; verflow: hidden"><tr><tdstyle="width: 50px;">
Born
</td><td><inputtype="text"name="nato_pf"style="width: 99%;" /></td></tr></table>
99% of width because with 100% the textbox goes over the table's border :) and also give a width to the first td ;)
jsFiddle http://jsfiddle.net/2yZmB/
Solution 3:
you can define another td element
<tablewidth="500px"style="border:1px solid black; overflow:hidden"><tr><td>Born </td><td><inputtype="text"name="nato_pf" /></td></tr></table>
css
input{
width:99%;
}
Post a Comment for "Input Text Box And Width 100%"