Reputation: 1391
I am displaying the html content in a table. For printing the tags i am using textArea
in the <td>
of the table. So i want to adjust the height and width of textArea
so that it is equal to the <td>
. How can i do this
Upvotes: 35
Views: 63537
Reputation: 131
When I added "min-width:98%;" it worked. I'm using jquery datatables.
Upvotes: 0
Reputation: 7341
Try using this CSS:
td textarea {
width: 100%;
height: 100%
}
Or inline:
<td>
<textarea style="width: 100%; height: 100%; border: none">
</textarea>
</td>
Upvotes: 4
Reputation: 19803
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*/
}
css
file, you can use inline csslike this:
<textarea style="border: none; width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;"> </textarea>
Upvotes: 52
Reputation: 2287
give the textarea a 100% width and height style
td textarea {
width:100%;
height: 100%;
}
but also take into account the paddings and borders or the textarea so that it would not overflow from the td.
hope this helps.
Upvotes: -2