/    Sign up×
Community /Pin to ProfileBookmark

textarea sizing and IE

Hey everyone,

I’ve run up against an extremely annoying IE quirk, and I’m wondering if anyone has found a workaround:

[CODE]
<table width=”100px” border=”1″>
<tr>
<td width=”100px”>
<textarea style=”width:100%;”>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</textarea>
</td>
</tr>
</table>
[/CODE]

Load this up in Firefox, and everything is fine: You get a nice 100 pixel cell with a 100 pixel textarea and wrapping text.
Load it up in IE, and something strange happens: The textarea is 100 pixels and the text appears wrapped, but the cell itself stretches out to accommodate the text on a single line.
I realise that the methods of sizing in my example are strange, but it is unavoidable due to the way the html is generated in the app I’m working on.

I’ve tried everything I can think of to get IE to render this is a sensible manner, but the only thing that works is setting table-layout:fixed, but isn’t acceptable in my case… Any ideas?

Thanks,

  • Michael
  • to post a comment
    HTML

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @BIOSTALLApr 15.2010 — Try this:

    [code=html]<table width="100" border="1" style="table-layout:fixed">
    <tr>
    <td width="100">
    <textarea style="width:100&#37;;">
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    </textarea>
    </td>
    </tr>
    </table>[/code]


    Try adding the shown style to your table and that should do it. Hope that helps ?
    ×

    Success!

    Help @Continuities spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.20,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...