How to wrap continous text?

G

goofire

Hi.

I have a line of text that is hundreds of characters long, and that I
need to display on a page.

Because the line is continuous with no spaces, the browser won't wrap
the text. My goal is to have the text wrap according to the size of
the browser window.

Anyone know how to do this? Thanks!

Example code:

<html>
<body>
......................................................................................................................................................................................................
</body>
</html>
 
D

David Dorward

I have a line of text that is hundreds of characters long, and that I
need to display on a page.

Because the line is continuous with no spaces, the browser won't wrap
the text. My goal is to have the text wrap according to the size of
the browser window.

Anyone know how to do this?

Add spaces or soft hypens (&shy;, but support is reported to be generally
poor) to the text.
 
B

Blinky the Shark

I have a line of text that is hundreds of characters long, and that I
need to display on a page.
Because the line is continuous with no spaces, the browser won't wrap

Okay, I'll bite: what kind of line is hundreds of unspaced characters
long?
 
G

goofire

If I simply add a space between each character it half's the amount of
information I can display on screen at once.

I want to maximize what is seen in the window, and that's why I want to
keep the lines continuous and have them wrap within the browser.

It sounds like there is basically no way to do this (?)
 
G

goofire

Ah yes, soft hyphens work in Firefox, but not Safari it seems. Thanks
for the half fix! ;-)
 
A

Andy Dingley

Okay, I'll bite: what kind of line is hundreds of unspaced characters
long?

I can think of plenty - just not any that someone would really need to
read.

You can shove spaces in all over the place (maybe every character), then
use CSS and word-spacing to make the spaces unnoticeable, but they'll
still permit wrapping.
 
L

Lauri Raittila

J

Jonathan N. Little

Lauri said:
in alt.html, (e-mail address removed) wrote:




CSS: white-space:pre-line;
http://www.w3.org/TR/CSS21/text.html#white-space-prop

For IE, word-wrap:break-word might work.

Don't know much about support.

And then there is of course <wbr>. More:
http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest

Why not rethink it. Just pre-break it into a static reasonable character
count, like 72 characters. Then with your presentation put it in a div
styled to separated it from your main text and convey that the genome
characters are one continuous block of code?
 
L

Lauri Raittila

in alt.html, Jonathan N. Little wrote:
[following my post, instead OPs for some reason]
Why not rethink it. Just pre-break it into a static reasonable character
count, like 72 characters. Then with your presentation put it in a div
styled to separated it from your main text and convey that the genome
characters are one continuous block of code?

I don't know how genome is to be used, but if it makes sence to copy
part/whole of this long string of characters, having spaces here/there
hurts copypasting.
 
A

AF

Hi.

I have a line of text that is hundreds of characters long, and that I
need to display on a page.

Because the line is continuous with no spaces, the browser won't wrap
the text. My goal is to have the text wrap according to the size of
the browser window.

Anyone know how to do this? Thanks!

Example code:

<html>
<body>
.....................................................................................................................................................................................................
</body>
</html>

Do you have a php enabled web server?

If so look into using php to break a long line into smaller strings.
then display the strings one after another.

If you need people to be able to access the data as one long line and
then use it as such, give them a link to download text file with the
long string in it.

And if you don't want to go to any more work than necessary, as in
typing and retype the string, put the string in a text file. Then
look into the php include command to retrieve the line as data from
the above text file, parse the line, ie break it up into smaller
variables, display the variables and a link to down load the file.
Then you have only typed the line in once.

By the way, if you have many of these one liners to show on the web,
and thus have many html pages to create, there are other ways php can
help you. You can for example create one html file as a template for
displaying a line, if that is what you want to do, and you can then
use the php to in effect create a web page per line. It can also
create links, and do many other things automatically. php saves a web
master a lot of time whenever he or she has repetitious data to
publish.

If you are interested, just send me an email ,
(e-mail address removed)
, taking out the appropriate letters, and give me some idea of what
you are trying to do. I can give you a rough idea of the commands and
logic you need to follow for no charge. I don't have the time to
teach you php, but it is actually very simple to learn, especially
considering how powerful it is.

I say easy to learn. What I should say is that while there is a lot
to php, a novice with little knowledge of a few commands, syntax, and
logic can be very effective on the web. To be an expert takes a lot
longer.






Best regards,

Al
http://www.affordablefloridainsurance.com
http://www.americanbestmortgages.com
 
A

Andy Dingley

Okay, what are a couple?

Any enormous data stream: genomics, crypto, source code, whatever you
want.

But it's a basic rule of communication that things that are difficult to
read are particularly difficult to make use of. We don't need to read
lines of more than 132 characters because we'd never remeber them, or
transcribe them accurately if we did. If you expect your poor bloody
user to actually _do_ something with these, then they need to be in
smaller chunks - our savannah-dwelling, lion-dodging brains just don't
"do" enormous text strings, unless you're Kim Peek.
 
A

AF

Any enormous data stream: genomics, crypto, source code, whatever you
want.

But it's a basic rule of communication that things that are difficult to
read are particularly difficult to make use of. We don't need to read
lines of more than 132 characters because we'd never remeber them, or
transcribe them accurately if we did. If you expect your poor bloody
user to actually _do_ something with these, then they need to be in
smaller chunks - our savannah-dwelling, lion-dodging brains just don't
"do" enormous text strings, unless you're Kim Peek.

Below is a large chunk of data. Can you read it? Pleasescroll down
to the end of the post.

---------------------------
-----Beginning of DATA

ÿØÿà JFIF



ÿÛ C  

 $.' ",#(7),01444'9=82<.342ÿÛ C


2!!22222222222222222222222222222222222222222222222222ÿÀ  p –

"



ÿÄ 





ÿÄ 7










!1AQa"q‘2?¡Áð#R±BC$b¢ÑáÿÄ 






ÿÄ %









!1"A‘aq23QÿÚ



 ? Ï& â¦*šáTEÏz`“<Whâ1Ë?35aÝX
Æ*¦y®±ô«ÁY
¬ÖÜf…ʘj’Þy?6
Àã4Ù?ƒÏ&…,2ÞÑ
©" ži„c¨§®(Á%(3L)Í8¶G†Hª,ŒúW@4í¼Ó¸
« 䉲i»I©²
7v
^HsÉb:U»6ò_š‰%^ôýÊd¹6ôËAs*9riÒm`28ªñì sW
B˜¬2Xz¶r6Ú¿)Å*ìp—ÎÚU[
dÉÜ.×ëÅF¸~îÙ¤œàqP|ä?Þº’h\–ÊùËSÏJ‰?G*zŠ»›MìÓ:QJc<µ#HXå©© U‡Jl ©À<T!Ö;ºR
IÅ5sšxb§5
%T*~js°)öè&åª9Ð$˜>Ë}îæ‘9®b•X's?Y»MIÆ¿«‰ù®ï¡Ph¥"(ÌŽÁTI5“²³ŽêK¬Ü'ýÄ›äT`[nxíÍg¯USÃ5[Qç’΃y"X]ß^ɶ9%.¹ý¨Ý?üW
n¥ŒRÎ
Ž'üDø¨í´˜nb_*xØBphù?*zhWV×uk,Ýe}¬à{nlV5}ÇLÛ+yk°Ê¬ŠàŠ¸\ šQ’a]Ä;
†a‚ ïÓ?µV¸“?
hOžl¼^ Ð^?
4ªŒ3ªp_áÈî.™wÒ7Úăú
Aî5ø#b’ V÷uãîAý(ˆˆ2Žyª—C|M’TñÁ ýÅi?L54»@ïõk%¤g$ôòÀcöÿ
ö‹ÚÝ?òÙŠ›?ƒöæ³ÇG€±`óí¹ò3ïDìCÅ5Ä°B‹ý£$çÓ#â“Z¥Å=µ”l§JÞ¦“ÙtÈ›‹ÑH
äqùŠ¨÷–…ðomƒz@?­\k˜Le_ wv.Íô
ùëP¾‹ê€ÆÑ‚0"uÏéòžŸLý)Q¿Ÿ´†J²K¼Ó.èSͱÿ
â¸a”20>„b³÷žJÍ‚7RBù$îØU{MCZÓîUWU¸0ÉY_z
;ñN?ó~„ÊÅ/f¥]âã¥w—9'š¹f©«Ø›½¡UH
4C( þáÉ_¨ÈúTRÚMm0IŒþÙ‡¨=ë\+F§]˜êQ”;è?”?Lç4Y´óðûúœUnÜœQ©!|Z3Þ(±ºÔ­
[\–Wå3€Aïùcõ¬ÌZmÕ„ÆIL‘4xË!qŸ§Jôh v¹E
<Ô:¥ºˆ¤B ±S??ç¥sîµ= Yx`£k†ÙÚ;ˆ?‰ a·Œ
­u…Þ›~¡7: Áb:ôèG½y?ÔíÁ?'
`zàãó¢ñ^Ý\n;”ô9ÝÖ°Ô§?£¡JxÓ=ïÈ°ò’0v”ÝÎrNOsÖ„Ë ?ñQÁp×ú|3™
í-qƒÇ¯Þ»ÒºV©|Q8×Ý/ÙÅ$R®74«F$…¤
JžkRé‘P¥£‰9‰Âv€•9ñyˆxCj|Ì04J;8€íSKíȪŠÍ¿â…ÎU:&0t[âeeDfN‘È™ë?jµ¿ò)Ѥë(mÅ~™íL?ö¸&ˆ«Fê2g«?åôî*é
/­ÕỸ?—)nÇ%˜žHtý†+9`Rw„
ÉBœ`?™wœõÏjÙÜÛ«.W¯j‚-9ïQ£ŸæSŽHÉtÁö¤«eŒÁýšá}?M}?>æãB¹ŠïO?”IóI
d¼‘Ðý=;סhZχ¼DÑÙÜn°º
K,Œ¢&'8ÎzqùÖwPðœÓ[ÉðQ“´;Àêp@¼Œr?ÝXö’Î×T„ßFþH`Έ0äuÇÁížÜÕGšñc¥Â^q=[SÓî4æxÞ&;ã¨õ£Þšlì °3Ý\CnÈó/ù¡ÚWýCñš`¸:f•ym …bµ•˜H±Ž›Xç'äõ¡ú.§¨xƒÆSxƒT±[/-
[@?ø{dƒÉã¿¢3ŸLÍ*tÛr_A“h–°,ˆTÉ('ž6®8üÏíY]ZÎêfY£e%C
§§Lg§ó5¯»C!gs—<ÖCV‘¢Gv•ãQþáÎ)U%Ê[Nc£Ï5¦Že?Õ¿
Xg¿?®j÷š¢ à
Πǽ6úW¸•âf2G?Á²y=¸ªéÒL¶ñÆ|Ö;
r´-ŽŠf·ÃÇL”î$Ž8è;ÑèaózÕ
?Nu¢Û#3ó3íßÔjÎ
±îÍo¥áM&rkÉN£h`°Í*´/1´œÒ©Ê~…¬Lȧީ3’ÜT&é™ðÂœäìÈëK?7Âo!H@h¹5À«óU8f‘S&¥k­ÑÐð’z&G”S †!Þª¦“Üoéê›öB+?ÀdÕè¦hÆäëB´øüé9­V?§$’®üb“U(¼ Šo¢æ“«Ãno|šËøª×Jט–„,Ã;e?†\÷÷üëÑ_E±’ÛiÛœVOPÒ`´—+øOj(ãhkù#Ó<Þ
'TÒœ=´‚æ5É(IVaôéŸJÓi—3oŽâV!1€Œ
?{‚z+åÄzb™ðÉu"Û
Éo¶i|S~#fõ ?)qAíÒ©^è6÷?J“m“!˜>ÞÙ¡q§ÈQƒü§3‘ûQ}JXõ
eŠgŠB D§cJš\rÍ4Ûå„cÀZ?žµ ÌôðÞcH§!—Óß#Ö´/ qÈòí
ßñ0'ÚŠi³Ü|µ¡V†0¡Û–8j)ž10ŽeÈ `ž¤z y$úž&?Ô!,=Ž­kR²ñx
íf$ª“\ófŒäf?Â-@
îêH#§
sêI
©ê&Ãi?ÉÆ+¥Fâž"ŽU{YÐIɃR
3N)Sãå¥Z°ÌÇ"‰%=*f¶!x¨Cª A¦É|@àýé3SÎƒÑ 
¦£d!N*
wæt«
usSŒ¢Q—žµÆ
i-È®6Oõù
CKoêÖ–£85š´GEÝŒU´šMø'ŠÉZ<¥‘±xɪOÁŠ{¨<ß?é‡?S¹„íÈ4ºqYÙs“hâ\’À†È«°–ŽxîT9ü«=ôšeÓsZ»|êé»Ëoò
ö"´ {§| ÜM/Ã>@áÄ…²3œœm
?É&Žm' áM½?몒j1ì‘A‘FzóéùŠ†þx ¶†Òý
Œäþ6#¯µe5=Zèݪ5Õ¬1ÆO–èû™?9ÉãŽ?=¨]¾¥-˜B56˜“–ÌKóv
'œU©éd/‰ïÍE‡‰4ئ%o§ñcŸ§Ö™õ[t’ûk?˻˘lvÈèGsׯ¥yâÚÚÝå…$,HÀy3? 
?iþ6º¶°[K=.V‘@Ù±X?3’{óïŠËV+¸¥ô?”²´Ûûf¢W¸°•á’

ãsœg¦Oo§B÷QŽVžB¡Ø $2}}*?Ï?/ÚŸPÓPÍ€“¤€
ŽÍŸ¥:)µMCI2?†ä†ošåÃl
û0äb?N´#(ãô"¥´å>NYý—~hœ¬ŠU½¥D4í/ý;NXßV…£$Bi¢Ú§•ùI
“Å*5{q`;?Ió;zÔM!n¦ yHlyn}ñOF
ÿ Ÿjß”cÁ29Z¹ iÎ ¦Ùyr
º>Ãÿ ´acŠ£ÄsYêVIá-—Ä£å20QKX-¼—iƒ
99DZÏθW®¬‘(1– 884‰NM“Ù1}ª6 ÊÃ!‡ ?j«4†1¹¶ªÿ s¹©—yF‰5&„
˜‹
µ¡Â’EgZ;ËÝA¢Ôîå¼H·V"bw
c?ŸcKSÇ}š%-§ ¬Z?–&’Ú7•W9~>?ò?µ ·ñÄË!¸»‚P»{9é·’
èyïÇ>T‡ôìbf`¥H;‚©[;ˆã§§4;LÔmÚÂ+[„¶ià|/œH
ž™ÆyäóŽã‘S9ØÅN1ô+ýnî3<vNÇcdFÒ~CŸàª?¼¬òyï+®IfÈ
ýzV¢ßàõkF³—É6øx¶6õàv=Èô Z­•ï‘#Ag¶Î1.@iç;¾§»RùzcTw +Khr˶8$¸ýóRÍ{µ"Š uP¾[?NqúPû&Gxe‡
¨ ’}³ëZ› ­U¸ž+òÚ€v?S°
?·4\[ì?àÏN&yö¢ü‡ ?âµÐìu ?.êâá
`•H÷oç¢?ÝOlÓÙ|QpÆHtûi¶Ÿùm¡Aÿ
·&ˆÚj›)lüOc§é‘³ŒÝX·•0`8â0CwëRQÑ#/ɧô+fŽÆÖ
&Ú3ýF#Ï»n:•ÁÇЕúV?PñdrÅ4×pjšœ.NÉgo-GÓÇQU¯4í*&‹â5;ÔóT¼3[Áº9?ô,Ÿ>¹çÖ³§V½Xå²·¼˜[d†‰Û
—¶GJ®)tmöjô¯h9h®Ì¶áT`-²KƒÜeˆ>”«
-¼vøó!¹yýiU”ÿÙ

-----End of Data
---------------------------

Go here to see it better:

[URL]http://www.friendsofblackwater.org/large_wall.jpg[/URL]

The point is there are legitimate uses of large strings of data, even
if you can't see them. In this case the jpg's data is converted to
something more "readable" by us.

In the case of the original poster, it sounds like he is using a
browser and the Web to show and to transfer data. Showing it can be
done by breaking it into smaller strings as several in this group have
suggested.

Using it is a different story.
Best regards,

Al
http://www.affordablefloridainsurance.com
http://www.americanbestmortgages.com
 
D

dorayme

Ah yes, soft hyphens work in Firefox, but not Safari it seems. Thanks
for the half fix! ;-)
In IE 5 for Mac or Mozilla, there seems no luck either. In one there is no
change, in the other there are raised hyphens...

What about this: you make a space between every tiny bit of life. Then it
will wrap, the info is so long anyway, would it matter if it is twice as
long?. But you can probably even control the spaces with css to be smaller
than usual and so not appear as normal. You will get it to look even, it
will be regular and it will wrap

dorayme
 
A

Andy Dingley

The point is there are legitimate uses of large strings of data,

But that isn't a "string" of data, in the way we're using "string" here,
to mean a sequence of characters, displayed as text glyphs.
 
L

Lauri Raittila

Yes, but you really failed to proof it... After all, even the point of
having JPG as string, as it is not possible to put this data back to get
image...
But that isn't a "string" of data, in the way we're using "string" here,
to mean a sequence of characters, displayed as text glyphs.

Puzzle: find all words in your language from following:

ferkrehgkehsjgthgjgajesaglrahesgbrksgknrkejgbrksebrkbegjrjerkgejrgkekjbee
rbkrebgkerkgbkjrbjergesankraebgjehkejgjshfjkdshgrkngkjnrjghejrkghejjeubro
odhgekkjehasgjrhgskhlkejleawöjaoöjgjwrejgsöldöfmwesjfgesnrvcajeosfsefejor
ailojkjkjkhgreejwaedaweöojaöwvnankdnfkelrfherklsagrerwakhfreklngkeskrngek

It is much easier to copy paste these words, if they are cut from the
middle if there is no space in between.

If you don't know the words, then you can't cut it nice parts beforehand.
And different people may prefer different lenght of lines. For puzzle, it
is not big problem, but lets say your job is to find something from this
kind of data...
 
N

Nick Theodorakis

in alt.html, Jonathan N. Little wrote:
[following my post, instead OPs for some reason]
Why not rethink it. Just pre-break it into a static reasonable character
count, like 72 characters. Then with your presentation put it in a div
styled to separated it from your main text and convey that the genome
characters are one continuous block of code?

I don't know how genome is to be used, but if it makes sence to copy
part/whole of this long string of characters, having spaces here/there
hurts copypasting.

Most tools for analyzing DNA sequence ignore spaces and line feeds
and many even discard line numbers.

Nick
 
N

Neredbojias

With neither quill nor qualm, Nick Theodorakis quothed
Most tools for analyzing DNA sequence ignore spaces and line feeds
and many even discard line numbers.

That explains it. I knew that the space in my wife's head got ignored
somehow.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top