SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    left justify in readonly textarea

    I have a readonly textarea. But the text displayed in the textarea is centered. Is there a way to display it left justified?

    Thanks

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2007
    Location
    North Yorkshire, UK
    Posts
    483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try <textarea style="text-align: left"></textarea>

  3. #3
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply.

    I have modified the codes as shown below. But still it does not work. Any idea?

    <td>
    <textarea id="xxx" name="xxx"
    dojoType="dijit.form.SimpleTextarea"
    maxLength="2000" readOnly="True"
    rows="3" cols="220" style="text-align: left">
    ${form.abc}
    </textarea>
    </td>

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2007
    Location
    North Yorkshire, UK
    Posts
    483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The textarea tag contains an attribute dojoType. Are you using dojo?

    I'm afraid I'm not familiar with that javascript framework but it could be that the attribute is getting set after the page has loaded.

    Is the page accessible from the web?

  5. #5
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, it is not accessible from the web.

  6. #6
    SitePoint Evangelist
    Join Date
    Jun 2007
    Location
    North Yorkshire, UK
    Posts
    483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would it be possible to post the html or reduce the html to something simpler that still exhibits the problem?

  7. #7
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Hang on, the simple text area from dojo is supposed to be centered.
    http://docs.dojocampus.org/dijit/form/SimpleTextarea

    What is the centered part that is causing you trouble?

    Is your trouble with the text area frame being centered on the screen, or is it with the text inside the frame being centered?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  8. #8
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It turns out that it was not really the centering problem. There were spaces between the right bracket of <textarea> and the text I want to display because I had it in the next line. I moved up the text to display right next to the right bracket of <textarea> and leading spaces disappeared.

    Thanks


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
  •