how to break a long word ?

Discussion in 'HTML' started by mike hengins, Jun 6, 2006.

  1. mike hengins

    mike hengins Guest

    Hi, I have a basic HTML question :
    How do i set the properties of a table so that it breaks a long word like
    "abcdefghijklmnopqrstuvwxyz"
    (this long word is dynamically generated), and not expand the table to fit
    the word ?
    I tried many things, like width and height, they will not cut it.

    Thanks for helping
     
    mike hengins, Jun 6, 2006
    #1
    1. Advertising

  2. mike hengins

    Mark Parnell Guest

    Deciding to do something for the good of humanity, mike hengins
    <> declared in alt.html:

    > How do i set the properties of a table so that it breaks a long word like
    > "abcdefghijklmnopqrstuvwxyz"


    You can't. A table cell will expand to fit the contents.

    > (this long word is dynamically generated),


    Get your script to insert a hyphen, space or similar every n characters
    when generating the string.

    --
    Mark Parnell
    My Usenet is improved; yours could be too:
    http://blinkynet.net/comp/uip5.html
     
    Mark Parnell, Jun 7, 2006
    #2
    1. Advertising

  3. mike hengins <> scripsit:

    > Hi, I have a basic HTML question :


    I don't think it's a basic HTML question; it's actually rather advanced. I
    don't know whether this matters, but you may have some reason for writing
    that you have a basic HTML question.

    > How do i set the properties of a table so that it breaks a long word
    > like "abcdefghijklmnopqrstuvwxyz"


    You don't.

    > (this long word is dynamically generated),


    So how could a poor lonesome browser know how it can be broken?

    A word, or a "word", can be broken in (at least) two ways: just breaking it
    at some point, so that a line break is just inserted somewhere, or as
    hyphenation. Both are problematic. It's impossible to say which one you need
    when you only gave a dummy example.

    For the relevant technicalities in HTML, see
    http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

    > I tried many things, like width and height, they will not cut it.


    They are not supposed to.

    Setting table-layout: fixed in CSS "forces" specified widths, but this is
    mostly part of the problem, not solution. You would need to consider
    including spaces, or explicit line break opportunities, or even explicit
    line breaks. The table cell content might still overflow. How would you plan
    to handle it?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jun 7, 2006
    #3
  4. mike hengins

    ironcorona Guest

    Mark Parnell wrote:
    > Deciding to do something for the good of humanity, mike hengins
    > <> declared in alt.html:
    >
    >> How do i set the properties of a table so that it breaks a long word like
    >> "abcdefghijklmnopqrstuvwxyz"

    >
    > You can't. A table cell will expand to fit the contents.


    Unless you explicitly set your td width


    --
    Brian O'Connor (ironcorona)
     
    ironcorona, Jun 8, 2006
    #4
  5. mike hengins

    Els Guest

    ironcorona wrote:

    > Mark Parnell wrote:
    >> Deciding to do something for the good of humanity, mike hengins
    >> <> declared in alt.html:
    >>
    >>> How do i set the properties of a table so that it breaks a long word like
    >>> "abcdefghijklmnopqrstuvwxyz"

    >>
    >> You can't. A table cell will expand to fit the contents.

    >
    > Unless you explicitly set your td width


    Won't help. Unless you set overflow:hidden or scroll, which still
    won't break the string into two lines.

    --
    Els http://locusmeus.com/

    Now playing: Yes - You Can Be Saved
     
    Els, Jun 8, 2006
    #5
    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. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    753
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,248
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Mathieu Dutour

    long long and long

    Mathieu Dutour, Jul 17, 2007, in forum: C Programming
    Replies:
    4
    Views:
    519
    santosh
    Jul 24, 2007
  4. Bart C

    Use of Long and Long Long

    Bart C, Jan 9, 2008, in forum: C Programming
    Replies:
    27
    Views:
    854
    Peter Nilsson
    Jan 15, 2008
  5. veryhotsausage
    Replies:
    1
    Views:
    1,902
    veryhotsausage
    Jul 4, 2008
Loading...

Share This Page