Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

wrapping the text - got from textarea

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
I get some text from textarea and display it in a table, like :
<table width='100%'>
<tr>
<td width='25%'> </td>
<td width='75%'><%= getMessage() %>
</tr>
</table>
This works fine when the text length is small enough to fit in the screen.
If I receive a lengthy message, with many lines, then I am having trouble displaying it.
Without any tags around the message, all redundant spaces, newlines are ignored.
If I enclose the message with <pre></pre>, the spaces and newlines are preserved, but a lengthy line is displayed in a single line (without wrapping). This makes the presentation ugly; we have to scroll towards right to read the message.
The following css sytles didn't help :
<p style='white-space: pre; width:100%'>
<p style='white-space: pre; text-align: justify'>
How do I display the message properly inside the table?
Any help is appreciated.
Regards,
Balaji
[ January 30, 2003: Message edited by: Jeya Balaji ]
 
Jeya Balaji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added <br> where ever Character.LINE_SEPARATOR occurs and now the appearance is as I expected.
 
reply
    Bookmark Topic Watch Topic
  • New Topic