View Full Version : How to style text in ContentPanel heading?

11 Feb 2010, 9:32 AM
Hi, I'm a beginner of GXT, hope I can get some answer for my dumb question.

I wanted to change the font color and weight of the ContentPanel heading but could not figure out how to do that. I found there is headerStyle field in this class but assigning it css values don't do anything.

ContentPanel cp = new ContentPanel();
cp.setHeading("This is a heading");
// how can i style the heading font?


12 Feb 2010, 12:02 AM
as the panel's heading is a string and when the source code is run it's include in html page, have you try html tags...
something like this:
ContentPanel cp = new ContentPanel();
cp.setHeading("<b> This is a heading </b>"); if you want the title to be bold ???

12 Feb 2010, 9:42 AM
Thank you Jocy,
It works! So to change color, I did "<span style='color:red'>Heading text</span>"

15 Feb 2010, 2:50 AM
it was a pleasure to help you!!!