• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Centering a column heading in a datatable

 
E Paisley
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is going to sound like a real newbie type question...

How do you center a column heading in a datatable. What I need to do is center the column heading but have the data be right aligned. I can't get the heading to act one way (center) and the column to act another (right aligned).

Any suggestions?
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CSS
 
E Paisley
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestion, although I am already doing that... The entire column only responds to the style in the header and not in the data values

[ October 01, 2008: Message edited by: Eric Paisley ]
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this if using verbatim is OK for you.



If it does not works out in this way try putting the whole column in div.
Hope this works.
[ October 01, 2008: Message edited by: Himanshu Gupta ]
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, it's usually enough to define a table headerClass attribute with centering, then define the columnClass for that column with right, left, or center alignment depending on what looks best for that column.

I do that all the time, such as when displaying columns with currency values (right-aligned) and text values (left-aligned), often centering items like dates and Y/N value columns.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic