Word wrap: Difference between revisions

1,597 bytes added ,  12 years ago
m (→‎{{header|Tcl}}: Make assumption explicit)
Line 76:
plaything.
</pre>
 
=={{header|Run BASIC}}==
Word Wrap style for different browsers.
This automatically adjusts the text if the browser window is stretched in any direction
<lang runbasic>doc$ = "In olden times when wishing still helped one, there lived a king ";_
"whose daughters were all beautiful, but the youngest was so beautiful ";_
"that the sun itself, which has seen so much, was astonished whenever ";_
"it shone in her face."
 
wordWrap$ = " style='white-space: pre-wrap;white-space: -moz-pre-wrap;white-space: -pre-wrap;";_
"white-space: -o-pre-wrap;word-wrap: break-word'"
' -----------------------------------------------------
' display doc$ at 60% and 40% of the screen
' -----------------------------------------------------
html "<table border=1 cellpadding=2 cellspacing=0><tr" + wordWrap$ +" valign=top>"
html "<td width=60%>" + doc$ + "</td><td width=40%>" + doc$ + "</td></tr></table>"</lang>
output will adjust as you stretch the browser
<pre>
---------- at 60%----------------------- | -------- at 40%----------------------
In olden times when wishing still helped one, there lived a king | In olden times when wishing still helped
whose daughters were all beautiful, but the youngest was so | one, there lived a king whose daughters
beautiful that the sun itself, which has seen so much, was | were all beautiful, but the youngest was
astonished whenever it shone in her face. | so beautiful that the sun itself, which
| has seen so much, was astonished whenever
| it shone in her face.
</pre>
 
 
 
=={{header|Tcl}}==
Anonymous user