Adjust the textArea height and width to fit in of a table

dabblet.demo
enter image description here

the problem is that textarea behave not normal box-model, that’s why we need this trick with box-sizing

this CSS will help you:

textarea {
    border: none;
    width: 100%;
    -webkit-box-sizing: border-box; /* <=iOS4, <= Android  2.3 */
       -moz-box-sizing: border-box; /* FF1+ */
            box-sizing: border-box; /* Chrome, IE8, Opera, Safari 5.1*/
}

if you have no access to css file, you can use inline css

like this:

<textarea style="border: none; width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"> </textarea>

Leave a Comment