aspose file tools*
The moose likes Struts and the fly likes How to format the text in a column using displaytag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to format the text in a column using displaytag?" Watch "How to format the text in a column using displaytag?" New topic
Author

How to format the text in a column using displaytag?

Vidya Gupta
Ranch Hand

Joined: Mar 18, 2012
Posts: 98

Hi All,

I am having a problem in display tag. In my application am having a drop down list called "city" with different values hyd, b'lore,and etc.
So when we select one option from the city drop down list and click on submit then a table data is displayed using display tag.
The table data contains diff columns like city name, state,description and etc..
But when i select city as Banglore it is displaying the table data correctly but the data in description column is not displaying in the correct format. It is happening with only when i select particular Banglore. Hw can i format the text in that column..?

description(hyd)
-------------
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa

description(chennai)
-------------
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa

description(when i select banglore)
--------------
aaaa
aaaaa
a
aaa
aaaaaaaa
aaaa
aaaaaa
aa
aaaaaaaaaaaa


In the above table the data in the description column for both chennai and hyd are displaying in the good format.

But in case of Banglore the data is not displaying properly.. That is actually the data can be adjusted in maximum of 3-4 lines but here the data is adjusted inin morethan 6-7 lines. This is only happening with this particular record.. Hw can i do this?? Please Give me any ideas...
Vidya Gupta
Ranch Hand

Joined: Mar 18, 2012
Posts: 98

I wrote the tag like below.. It is displaying the data in description column in single line..

<display:column property="description" class="normalfont" style="width:2%;white-space:nowrap;"/>

Can any body suggest me what more values can i use in style attribute of display tag..
Vidya Gupta
Ranch Hand

Joined: Mar 18, 2012
Posts: 98

I used different values for style attribute like,

style=white-space:nowrap / normal / pre / pre-line / pre-wrap / inherit;
sytle=word-wrap:break-word;
style=word-break:break-all;

But the text format is not changing correctly... Please suggest me if some more values are there to format the text.

Thanks,
Vidya
 
wood burning stoves
 
subject: How to format the text in a column using displaytag?