• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

displaying long strings

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, i inputted a string in a text area where
i used <enter> to start new lines and then saved
it in the database. when i retrieved the string
from the database the format is retained when i
display it in a textarea but when i tried to
display it in an ordinary table the supposedly
next line of strings was displayed on the same line.
how do i go about this?
thanks.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds like a HTML problem: the carriage return or line feeds are being ignored by the browser.
You can either wrap the table data contents in a presentation tag
<pre>present \n this \n\t data</pre>
or you can use a StringTokenizer to cut the end of line characters and swop them with a HTML break <br>
I hope I understood correctly...
Dave
 
christine lorraine
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it worked! many thanks to you.
i preferred <pre></pre> tag because it
seemed to work faster than manipulating
the string using String Tokenizer.
thanks again
 
What are your superhero powers? Go ahead and try them on this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic