How to get wordwrap on your page using a table
May 3, 2021 6:26:00 GMT -5
Post by donnybowers on May 3, 2021 6:26:00 GMT -5
This is something that bothered me about RB for the longest time. I finally figured out how to wordwrap my pages simply by wrapping them in a <TABLE> with wordwrapping CSS on the <TD> as follows:
Now if I could just find a way to do this with a TEXTAREA I'd be in business.
EDIT:
You don't need to tweak the program's CSS code as I did to get a TEXTAREA to wordwrap. StefanPendl shared a piece of code below that solves this problem I've been wrangling with for the past few years as follows:
cssclass "td", "{width:100%; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word}"
html "<center><h1>Page Wrapped Paragraph</h1>"
html "<table width=640 border=0><tr><td width=100%>"
html "16 For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life. 17 For God did not send His Son into the world to condemn the world, but that the world through Him might be saved. (John 3:16-17)"
html "</td></tr></table></center>"
Now if I could just find a way to do this with a TEXTAREA I'd be in business.
EDIT:
You don't need to tweak the program's CSS code as I did to get a TEXTAREA to wordwrap. StefanPendl shared a piece of code below that solves this problem I've been wrangling with for the past few years as follows:
for i = 1 to 10
text$ = text$ + "Hello world! "
next
' set CSS id for line wrapping
cssid #tawrap, "{white-space: pre-line;}"
textarea #box, text,ドル 40, 10
' apply CSS for line wrapping
#box setid("tawrap")
print
link #action, "Accept", [accept]
wait
[accept]
text$ = #box contents$()
print
print text$
wait