![]() |
|
|
|
#1 |
|
Hi, how can I use <div> that will break too long lines as table do, i.e. I have realy long text aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaa or i have a <div><pre>... situation, and I want too long lines to be hard- broken to fit div width. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~l-.~~~~~~~~~~~~~~~~~~~ GG-1175498 ____| ]____, Rafal 'Raf256' Maj X-( * ) Rafal(at)Raf256(dot)com ,"----------" Rafal 'Raf256' Maj |
|
|
|
|
#2 |
|
Posts: n/a
|
On 25 Feb 2004 05:12:35 GMT, "Rafal 'Raf256' Maj" <>
declared in alt.html: > Hi, how can I use <div> that will break too long lines as table do, i.e. I > have realy long text > aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaa Get your script to insert spaces after every n consecutive non-breaking characters. A table doesn't wrap long text any more than any other element does. -- Mark Parnell http://www.clarkecomputers.com.au |
|
|
|
#3 |
|
Posts: n/a
|
Mark Parnell <> wrote:
>> Hi, how can I use <div> that will break too long lines as table >> do, i.e. I have realy long text >> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaa > > Get your script to insert spaces after every n consecutive > non-breaking characters. I guess the question most often arises when someone has souped up a guestbook script or found one, then sees what happens when someone types a long string without spaces. There are usually more serious problems than that, then, and what is probably needed is to reconsider what's the big idea in a guestbook script (there's actually no serious shortage of virtually empty guestbooks on the Web) and then, maybe, finding a _good_ guestbook script from a suitable distribution site. The details depend on the authoring environment as usual. -- Yucca, http://www.cs.tut.fi/~jkorpela/ Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html |
|
|
|
#4 |
|
Posts: n/a
|
news:Xns949A666BBF7A2jkorpelacstutfi@193.229.0.31
>> Get your script to insert spaces after every n consecutive >> non-breaking characters. > I guess the question most often arises when someone has souped up a > guestbook script or found one, then sees what happens when someone > types a long string without spaces. Som there is no (X)HTML way to make an element that will force braking of lines? Wouldn't that be a good idea to add element like this into next CSS? -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~l-.~~~~~~~~~~~~~~~~~~~ GG-1175498 ____| ]____, Rafal 'Raf256' Maj X-( * ) Rafal(at)Raf256(dot)com ,"----------" |
|
|
|
#5 |
|
Posts: n/a
|
"Rafal 'Raf256' Maj" <> wrote:
> Som there is no (X)HTML way to make an element that will force > braking of lines? Surely. <br> (or <br />) to begin with. As we move to _allowed_ line breaks, things get rather complicated. So make sure you're solving the right problem. Then, re-check that. Are you sure you are doubly sure? Click here to continue. Oops, try this: http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest > Wouldn't that be a good idea to add element like this into next > CSS? CSS has no elements. -- Yucca, http://www.cs.tut.fi/~jkorpela/ Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html |
|
|
|
#6 |
|
Posts: n/a
|
Rafal 'Raf256' Maj wrote:
> Som there is no (X)HTML way to make an element that will force braking of > lines? Breaking lines partway through a word is generally considered undesirable. -- Toby A Inkster BSc (Hons) ARCS Contact Me - http://www.goddamn.co.uk/tobyink/?page=132 |
|
|
|
#7 |
|
Posts: n/a
|
Mark Parnell a écrit:
> On 25 Feb 2004 05:12:35 GMT, "Rafal 'Raf256' Maj" <> > declared in alt.html: > >> Hi, how can I use <div> that will break too long lines as table do, i.e. >> I have realy long text >> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaa > > Get your script to insert spaces after every n consecutive non-breaking > characters. > > A table doesn't wrap long text any more than any other element does. > An example of such a PHP function: <?php /* insert a space (or any $separator ) every $lenght caracter */ /* only for words longer than $lenght */ function cutLongWord($string, $lenght, $separator) { if ($separator == null) { $separator= ' '; } return preg_replace('/([^ ]{'.$lenght.'})/si','\\1' .$separator , $string); } ?> It's a rough sketch of a function that could be refined but should face most situations where you have posters with a broken spacebar. Bonne chance! -- mv sco /dev/null Marc Nadeau # La Pagerie /* http://www.pagerie.com */ |
|