SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Evangelist Pixelateur's Avatar
    Join Date
    Feb 2006
    Location
    Hamburg, Germany
    Posts
    593
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How to left-align text in a text_area?

    Please have a look at this screenshot: http://www.ukautobarn.com/images/form_screenshot.tiff

    How can I make the text aligned at the left side of the text_area just like in the text_fields??? It's just not working for me. Any ideas??

    The code is fairly simple:

    <table class="largeTable" cellspacing="0">
    <tr>
    <td class="label">Name</td>
    <td><%= text_field("page", "name") %></td>
    </tr>
    <tr>
    <td class="label">Keywords</td>
    <td><%= text_field("page", "keywords", 'class' => 'longer') %></td>
    </tr>
    <tr>
    <td class="label">Body Text</td>
    <td><%= text_area("page", "body", 'class' => 'longer format') %></td>
    </tr>
    <tr>
    <td class="label"></td>
    <td><input type="submit" value=" <%= @button %> ">
    </tr>
    </table>

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not text align, as the left edge of the text is flush. Does this happen in other browsers, can you post the stylesheet?

  3. #3
    SitePoint Evangelist Pixelateur's Avatar
    Join Date
    Feb 2006
    Location
    Hamburg, Germany
    Posts
    593
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's the CSS. It's fairly simple. I've already played around with the "format" class for nearly an hour. I've also tried the "whitespace" property, but no success. And yes, there is plenty of whitespace in the source (the content is pulled from a database), but outside "textarea" tags, everything is neatly aligned on the left (e.g. in "textfield" tags).

    .largeTable {
    width: 910px;
    }

    .largeTable td {
    max-width: 95px;
    }

    .largeTable .imageCell {
    width: 150px;
    max-width: 150px;
    padding: 0;
    }

    .largeTable .label {
    width: 20%;
    }

    .largeTable .longer {
    width: 100%;
    }

    .largeTable .format {
    font-size: 70%;
    text-align: left;
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •