how to force clipping or wrapping?

Discussion in 'ASP .Net' started by Steve, Jan 21, 2004.

  1. Steve

    Steve Guest

    I just noticed a bug on my site where if someone enters a continuous string
    of characters like
    "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

    and I have that being rendered into a table with a width set to say.. 100,
    it will stretch the table to fit all those characters. Enforcing characters
    wouldn't really work cause the cell is allowed to wrap, they can enter a ton
    of text if they want to, but when there are that many characters next to
    each other... it breaks it. I know I could sit there and count characters
    and watch for spaces and determine when something smells bad, but there must
    be an easier way to do this.

    I have tried explicitly setting the <td> to the desired width, that won't
    stop it either.

    Any ideas?

    Steve
     
    Steve, Jan 21, 2004
    #1
    1. Advertisements

  2. I'm afraid the method you described ("sit there and count characters
    ....") is the only way.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.
     
    Kevin Spencer, Jan 21, 2004
    #2
    1. Advertisements

  3. Steve

    Guogang Guest

    A textarea with cols='50' may solve your problem.
    Or style: STYLE="word-wrap:break-word;"
     
    Guogang, Jan 21, 2004
    #3
  4. Steve

    Steve Guest

    WOOHOO!!

    That worked perfect! It only works in IE, but, to be honest...... for this
    site I don't care.

    Thanks for the tip!
    <TD width="300" style="word-wrap:break-word">
     
    Steve, Jan 22, 2004
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.