5

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.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Nupur
  • 153
  • 3
  • 5
  • 11

1 Answers1

12

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

Amal Dev
  • 1,938
  • 1
  • 14
  • 26
  • Worth a mention that class `text-right` is already defined in bootstrap.css, along with `text-left`, `text-center`, etc. – David Clarke Jul 07 '20 at 03:57