Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to make textarea fill entire cell in a table

Tags:

html

css

textarea

I have designed this table for reporters to browse information about their reports in the database, and the textareas at the top function as both search fields and table heads -- which show what is in each column.

However, a problem I have run into is that when the table shifts dimensions because of content, the textareas (obviously) do not shift along with them.

My question is this; is there a way to force the textarea take up the entire area of the cell they are in?

http://i.imgur.com/twOmA.png

like image 571
Dương Văn Avatar asked Oct 21 '11 04:10

Dương Văn


People also ask

How to make textarea 100% width?

The idea is to create a div with the class name “wrapper”. Inside that <div> element, we create a text area with a certain number of columns and rows. In this case, it is 30 and 15 respectively. After that, we set the width property to 100% to make a textarea width 100%.

How do I restrict textarea size?

In some cases, there is a need of putting a limit on the size of characters that can be typed in a textarea. So in that case, we can use maxlength attribute to control the number of characters entered in a textarea.


1 Answers

Try:

textarea {
   width: 100%;
}

Example: http://jsfiddle.net/ravan/JZwhH/

like image 171
Ravan Scafi Avatar answered Sep 27 '22 18:09

Ravan Scafi