How can I change cols of textarea in twitter-bootstrap?
ruby-on-rails-3, twitter-bootstrap
Solution
The other answers didn't work for me. This did:
<div class="span6">
<h2>Document</h2>
</p>
<textarea class="field span12" id="textarea" rows="6" placeholder="Enter a short synopsis"></textarea>
<button class="btn">Upload</button>
</div>
Note the `span12` in a div with `span6`.
Problem
If I change the value of :rows, it works. But it stays at the default cols whatever value I set with ':cols =>'. Column width won't change. I viewed the html source and it reflected the change. I wonder that bootstrap's CSS might be the suspect... HTML (there is a "cols=" in the final HTML, but column width stays at the default value, which is 30. I can't believe my eyes!) ``` <textarea cols="100" id="comment_body" name="comment[body]" rows="5"></textarea> ``` Rails: ``` <%= form_for([@post, @post.comments.build]) do |f| %> <div class="field"> <i class="icon-user"></i> <%= f.text_field :commenter %> </div> <div class="field"> <i class="icon-comment"></i> <%= f.text_area :body, :rows => 5, :cols => 100 %> </div> <div class="actions"> <%= f.submit %> <div> <% end %> ```