How to set alignment of cells in Kendo grid after formatting it

18,616

You can achieve that using headerAttributes and Attributes property in the column description.

{
    field: "n",
    headerAttributes:{ style:"text-align:right"},
    attributes:{ class:"text-right" } ,
      //template: "<div style='text-align:right'>#= n #</div>",
    format: "{0:n}", type: "number"
  } 

Please see the updated fiddle here

Share:
18,616
Nupur
Author by

Nupur

Updated on June 11, 2022

Comments

  • Nupur
    Nupur about 2 years

    I am using Kendo grid in my project.

    I am using culture script for internationalization.

    Using that script it formats the numbers in grid depending upon culture I want to align the numbers to right, how can I achieve it?

    Here is a fiddle where I am formatting number column.

  • David Clarke
    David Clarke almost 4 years
    Worth a mention that class text-right is already defined in bootstrap.css, along with text-left, text-center, etc.