• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying only part of data in JSP Page

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers

I have to provide a tabluar view of the data retreiving from the database table. One column has a long description of the data where by i have provided 50% width for it. Once it is exceeding the 50% width, the information is going to the next line (like WRAP Text) which is making my display un-tidy.

I would like display only the information with 40 characters, so that all the table rows will look perfectly.



Attached here with the sample output of the table. Please look at line number 37

Please let me have a solution for this.

Thanks/Regards

Aravind Prasad
project_list.jpg
[Thumbnail for project_list.jpg]
Image File
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what happened when you apply nowrap attribute to the column[<td/>] ?

note: If it is a development project which you are coding a jsp, please avoid scriptlet, because you will end up with writing business logic in jsp which is difficult to maintain and debug!
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear seetharaman

Thanks for the feedback.

I tried no-wrap before and if i put, the information is streatching the table and it is becoming un-tidy. The only option is to display few characters.

The solution in my mind is

1. get the value in the string.
2. make substring
3. display the sub-string.

I am not sure whether the above login is correct or is there any easier way to sort this out.

Thanks/Regards

Aravind
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my opinion: get the shorted string and display with more link, when the user click on the more then display the whole story on a popup window
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Seetharaman

Thanks again. Your proposal is really good, but customer wants it the way i explained.

Presently I am using the substring option and displaying is fine and the customer is happy. Code is provided FYI and please refer the screen shot's line number 37




If there is any easier way, please advise, so that i can update myself accordingly.

thanks/Regards
project_list.jpg
[Thumbnail for project_list.jpg]
Image File
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wonder the project name is meaningful? and how about using a tooltips?
 
Chandraprakash Sarathe
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope this will help.Better create a css file and define style for each class , you may have separate style for <tr> , <td>

 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aravind Prasad wrote:Dear Seetharaman

Thanks again. Your proposal is really good, but customer wants it the way i explained.

Presently I am using the substring option and displaying is fine and the customer is happy. Code is provided FYI and please refer the screen shot's line number 37




If there is any easier way, please advise, so that i can update myself accordingly.

thanks/Regards


sorry if I misunderstood, but you want an easier solution than using substring?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic