Rails Simpleform setting the width of a form input element

I'm using the gem simpleform inside a table

I want to adjust the width of each form element of the simple form can I do that?

I tried the following but it doesn't seem to work

    <td><%= listing.name %></td>
<td><%= f.input :suite, :input_html => { :size => 10, :maxlength => 10 } %></td>

I looked at the simpleform documentation here but couldn't find how to specifically set the width. Here is what my form inside a table looks like. I'd like to make the columns narrower.

As you can see the column widths are very wide. Please advise how to make them the appropriate size so they don't take too much space.

Answers


I've used <%= f.input :fieldname, :input_html => {:maxlength =>2,:style=> 'width: 20px'}%> with success. Are you suppressing all labels? (via :label=>false)?


Need Your Help

How to pick the latest file to archive in a folder in batch file

batch-file

I have a multiple files in a folder date-wise like: accnt20140127,accnt20140128,accnt20140129,accnt20140130,accnt20140131 etc

Is it possible to retrieve a list of WebLogic Domains from Node Manager?

weblogic

Given a connection to NodeManager is it possible to have it tell you what domains it has registered?