File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes text-align in h:dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "text-align in h:dataTable" Watch "text-align in h:dataTable" New topic
Author

text-align in h:dataTable

Daniel Gee
Ranch Hand

Joined: Aug 29, 2003
Posts: 202
I created a data table with four columns. By default, the text of each column of the table is left aligned.

I am trying to make the text of certain columns of the table to be 'centered'. And I tried to use the columnClasses in the dataTable tag to do it but failed (i.e. all text is still left aligned.). Maybe someone could help me in spotting the mistake that I made.

My JSP:


I swear that I can access the stylesheet MilPDS_Style.css because the rest of the specifications in the stylesheet get picked up successfully. And my MilPDS_Style.css has:
Daniel Gee
Ranch Hand

Joined: Aug 29, 2003
Posts: 202
Let me answer my own question.

Add width of the column and "nowrap: true;" for that column in the stylesheet solve the problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: text-align in h:dataTable
 
Similar Threads
Foreign key field population from datatable to textbox?
popup
IExplorer and general troubles... like loss of sanity.
using CSS float attribute makes things 'leak' out of their containers ?
RichFaces SuggestionBox Not Displaying Values