# Cols not responding in text\_area

**URL:** <https://www.ruby-forum.com/t/cols-not-responding-in-text-area/113670>\
**Category:** Rails\
**Created:** [September 3, 2007, 5:45pm UTC](https://www.ruby-forum.com/t/cols-not-responding-in-text-area/113670 "2007-09-03T17:45:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [September 3, 2007, 5:45pm UTC](https://www.ruby-forum.com/t/cols-not-responding-in-text-area/113670/1 "2007-09-03T17:45:40Z")

</div>

Hi:

I’m doing a pretty simple text\_area in a form. I need it to have a  
minimum width that’s really small - about 10, or 10 cols. I’ve tried it  
both ways, and neither will go small enough to what I need. Does  
textarea in HTML have an absolute minimum? I have no styles applied to  
text\_area:

\<%= text\_area\_tag “message”, nil, :cols=\> “2”, :rows =\> “3”%\>

renders HTML:

but the actual cols is like 20. Any ideas?

Thanks!

Mike

---

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [September 10, 2007, 3:04pm UTC](https://www.ruby-forum.com/t/cols-not-responding-in-text-area/113670/2 "2007-09-10T15:04:07Z")

</div>

On Sep 3, 4:45 pm, Mike D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> but the actual cols is like 20. Any ideas?

Hi, I’ve got he same problem… did you ever find a solution to this?

Cheers,

JS

---

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [September 10, 2007, 3:21pm UTC](https://www.ruby-forum.com/t/cols-not-responding-in-text-area/113670/3 "2007-09-10T15:21:09Z")

</div>

On Sep 3, 4:45 pm, Mike D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> renders HTML:
> 
> but the actual cols is like 20. Any ideas?

## I’ve now used CSS to do the size:

\<%= f.text\_area :notes, :rows =\> 3, :cols =\> 10, :class =\>  
‘small\_textarea’ %\>

I’m guessing that the size shouldn’t be regulated in HTML but in CSS  
due to accessibility etc.

Hope that’s of any use to anyone who’s scratching their heads too. 🙂

## JS textarea.small\_textarea { height: 6em; width: 25em; }
