Wraping text while displaying it

Discussion in 'HTML' started by dynamota@gmail.com, Apr 3, 2006.

  1. Guest

    Hi All,


    I have a page that has a text area where people can input text. They
    submit the form and go to the next page which is a "preview" page. The
    textarea data is displayed in a table/td whose width is set to 400.

    But if some one puts in a data like
    ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
    ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
    ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

    It's one continues string with no breaks.

    How can I display the above text within a 200 width area? I am not able
    to confine it to a width of 200. Its seems to keep rolling to the
    right...

    Any leads or suggestions will be useful.

    tx in advance,
    , Apr 3, 2006
    #1
    1. Advertising

  2. wrote:

    > But if some one puts in a data like

    [snip]
    > one continues string with no breaks.


    [the table data cell expands the width of the table]

    > Any leads or suggestions will be useful.


    Don't let users input long words. Reject the form submission and insist they
    add some spaces.


    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Apr 3, 2006
    #2
    1. Advertising

  3. Steve Pugh Guest

    wrote:

    >I have a page that has a text area where people can input text. They
    >submit the form and go to the next page which is a "preview" page. The
    >textarea data is displayed in a table/td whose width is set to 400.
    >
    >But if some one puts in a data like
    >ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
    >ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
    >ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
    >
    >It's one continues string with no breaks.
    >
    >How can I display the above text within a 200 width area? I am not able
    >to confine it to a width of 200. Its seems to keep rolling to the
    >right...


    Is it 400 or 200?

    >Any leads or suggestions will be useful.


    Go and hit your users around the head until they stop inputting such
    stupid content. ;-)

    You can't make content with no breakable characters break. So either
    insert breakable characters or truncate the content. As you don't know
    the user's chosen font size this will involve some amount of
    guesswork.

    If you stop trying to constrict the width of the container then the
    problem will go away for some cases, which leaves you with more time
    to track down and hit around the head the remainder.

    Steve
    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Apr 3, 2006
    #3
  4. Guest

    sorry

    I would say a width of 400. Though you set it to 400, it expands beyond
    400.

    I might have to come with a way to implement some of the ideas
    suggested.


    tx
    , Apr 3, 2006
    #4
  5. wrote:
    > I would say a width of 400. Though you set it to 400, it expands beyond
    > 400.
    >
    > I might have to come with a way to implement some of the ideas
    > suggested.


    You message headers claim that this is a response to my first post to this
    thread, but you content looks like a response to Steve Pugh's, and you
    haven't quoted anything.

    Please read http://cfaj.freeshell.org/google/

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Apr 3, 2006
    #5
  6. Guest

    David,
    Tx for the lessons in netiquette.

    Looks like the only way to go is to write a function
    I am planning to write a function that would put a break at certain
    values(which will be passed as a parameter). I was hoping to use
    html/css and avoid writing a function.


    TX all......


    David Dorward wrote:
    > wrote:
    > > I would say a width of 400. Though you set it to 400, it expands beyond
    > > 400.
    > >
    > > I might have to come with a way to implement some of the ideas
    > > suggested.

    >
    > You message headers claim that this is a response to my first post to this
    > thread, but you content looks like a response to Steve Pugh's, and you
    > haven't quoted anything.
    >
    > Please read http://cfaj.freeshell.org/google/
    >
    > --
    > David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    > Home is where the ~/.bashrc is
    , Apr 3, 2006
    #6
  7. wrote:
    > David,
    > Tx for the lessons in netiquette.
    >


    Well you got one of two, you quoted but you top posted. FWIW your
    remarkes should have been locate
    |
    V

    > Looks like the only way to go is to write a function
    > I am planning to write a function that would put a break at certain
    > values(which will be passed as a parameter). I was hoping to use
    > html/css and avoid writing a function.
    >

    |
    V
    >
    > TX all......
    >
    >
    > David Dorward wrote:
    >> wrote:
    >>> I would say a width of 400. Though you set it to 400, it expands beyond
    >>> 400.
    >>>
    >>> I might have to come with a way to implement some of the ideas
    >>> suggested.

    >> You message headers claim that this is a response to my first post to this
    >> thread, but you content looks like a response to Steve Pugh's, and you
    >> haven't quoted anything.
    >>
    >> Please read http://cfaj.freeshell.org/google/

    |
    V
    About down here under what you are responding to. and you should remove
    the previous poster's signature(if your software doesn't do it
    automatically), it's the bit after the '--'

    >> --
    >> David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    >> Home is where the ~/.bashrc is

    >



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Apr 4, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Tillotson
    Replies:
    2
    Views:
    427
    Chris Tillotson
    Nov 4, 2003
  2. Mike Bridge
    Replies:
    2
    Views:
    4,694
    Mike Bridge
    Feb 20, 2004
  3. MattB
    Replies:
    2
    Views:
    5,187
    MattB
    Nov 12, 2004
  4. Carlos
    Replies:
    2
    Views:
    292
    Patrice
    Feb 21, 2005
  5. Dan

    To stop text wraping in an datagrid asp.net 2003

    Dan, Feb 25, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    97
Loading...

Share This Page