Center Grid Column Captions

I am not able to center the Grid column captions. I have the following CSS:

.text-align-center { text-align: center; } I am setting the style like so:

HeaderRow headerRow = countSummaryGrid.getDefaultHeaderRow();

HeaderCell testCycleHeaderCell = headerRow.getCell(“Test Cycle”);
testCycleHeaderCell.setHtml(“Test Cycle”);
[/code]The caption is not centering. However, if I do the following in the footer, it does get centered:

FooterRow footerRow = countSummaryGrid.getFooterRow(0);

FooterCell totalsFooterCell = footerRow.getCell(“Test Cycle”);
[/code]Why would it work for the footer but not the header?


That should work. The best way to debug the problem is probably to use Chrome inspector (or equivalent) to see which CSS rules apply. It might be there is some more specific rule that overrides the centering.


Hi Pontus,

Thanks for the reply! I opened an issue on GitHub for this →

I don’t see the style getting applied to the class when I inspect it in Chrome. It’s either a bug or I am missing something really obscure. Either way, I would think the same technique should work on a HeaderCell that does on a FooterCell.