View Full Version : How to make heading text in the center of header
I have a question about how to make heading text in the center of header. Is there any appropriate method to resolve the question?
20 May 2009, 6:41 PM
There are a couple ways to do it:
When you build your Grid, in your ColumnConfig for the relevant column:
ColumnConfig myColumn = new ColumnConfig("my", "My", 35);
If it's a Table, same deal on the TableColumn object.
Note that this will align the entire column center, not just the header.
To modify just the Header one possibility might be to get the GridView (<grid>.getView()) and get the header Element using getHeaderCell(int colIndex), and set the style attributes directly.
I am not sure that's the right approach, but it's worth checking out.
first, thanks for you answer.
But if it is in the ContentPanel's heaer, what can I do?
21 May 2009, 5:56 AM
Have you tried using CSS (panel.getHeader().setId(cssId)) and setting text-align: center ?
Powered by vBulletin® Version 4.1.5 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.