1. #1
    Ext User
    Join Date
    Dec 2007
    Posts
    9
    Vote Rating
    0
    alanqueiroz is on a distinguished road

      0  

    Default Center ContentPanel Header Text

    Center ContentPanel Header Text


    I would like to center the header text of ContentPanel. If I create a css class and add to the header object, it works:

    Code:
    / / MyCss.css
    .centerTextAlign (
     text-align: center;
    )
    
    ContentPanel gridContainer = new ContentPanel();
    gridContainer.getHeader().addStyleName("centerTextAlign");
    But why this:
    Code:
    gridContainer.getHeader().setStyleAttribute("text-align", "center");
    or this:
    Code:
    gridContainer.getHeader().getElement().getStyle().setProperty("text-align", "center");
    does not work?

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,753
    Vote Rating
    113
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    You need to set it this way:

    Code:
    getHeader().setStyleAttribute("textAlign", "center");

  3. #3
    Ext User
    Join Date
    Dec 2007
    Posts
    9
    Vote Rating
    0
    alanqueiroz is on a distinguished road

      0  

    Default


    Thank you!