Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > how to break a long word ?

Reply
Thread Tools

how to break a long word ?

 
 
mike hengins
Guest
Posts: n/a
 
      06-06-2006
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


 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      06-06-2006
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
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      06-07-2006
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/

 
Reply With Quote
 
ironcorona
Guest
Posts: n/a
 
      06-08-2006
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)
 
Reply With Quote
 
Els
Guest
Posts: n/a
 
      06-08-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Having compilation error: no match for call to ‘(const __gnu_cxx::hash<long long int>) (const long long int&)’ veryhotsausage C++ 1 07-04-2008 05:41 PM
`if (!p ? i++ : 0) break;' == `if (!p){ i++; break;}' ? lovecreatesbea...@gmail.com C Programming 12 04-14-2008 07:59 AM
unsigned long long int to long double Daniel Rudy C Programming 5 09-20-2005 02:37 AM
Assigning unsigned long to unsigned long long George Marsaglia C Programming 1 07-08-2003 05:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57