Column Header alignment

6 posts, 1 answers
  1. Troy
    Troy avatar
    31 posts
    Member since:
    Oct 2011

    Posted 27 Jun 2012 Link to this post

    How can I center align the text in my column headers?
  2. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 28 Jun 2012 Link to this post

    Hello Troy,

    You could use a CSS selector with the widget’s specific CSS class for customizing the appearance of any particular widget. The needed CSS classes are listed in this topic from our online documentation. For example this snippet can be used for centering the text in the grid column headers: 

    .k-header .k-link{
       text-align: center;
    }

    I hope this information helps.
     

    Greetings,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Troy
    Troy avatar
    31 posts
    Member since:
    Oct 2011

    Posted 28 Jun 2012 Link to this post

    Thanks so much!
  4. Mark
    Mark avatar
    22 posts
    Member since:
    Aug 2015

    Posted 26 Apr 2016 in reply to Iliana Nikolova Link to this post

    What if you only want to align certain column  headers, not all of them...???  Thanks
  5. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    651 posts

    Posted 29 Apr 2016 Link to this post

    Mark,

    you can easily do so by specifying the "headerAtrributes" of the desired columns, just like in this example: http://dojo.telerik.com/@joneff/aQImE.

    Note that due to CSS specificity, if you use a single class name, you will need to have !important rule, or alternatively a more specific selector.

    If you use inline styles, you don't have to worry about specificity.

    Regards,
    Ivan Zhekov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Mark
    Mark avatar
    22 posts
    Member since:
    Aug 2015

    Posted 29 Apr 2016 in reply to Ivan Zhekov Link to this post

    Perfect, thanks!
Back to Top