【问题标题】:How to set alignment of cells in Kendo grid after formatting it格式化后如何在剑道网格中设置单元格的对齐方式
【发布时间】:2015-07-29 17:10:03
【问题描述】:

我在我的项目中使用剑道网格。

我正在使用文化脚本进行国际化。

使用该脚本,它会根据文化格式化网格中的数字 我想将数字对齐,我该如何实现?

Here is a fiddle where I am formatting number column.

【问题讨论】:

    标签: telerik kendo-grid telerik-grid


    【解决方案1】:

    您可以使用列描述中的 headerAttributes 和 Attributes 属性来实现。

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

    请查看更新后的fiddle here

    【讨论】:

    • 值得一提的是,text-right 类已经在 bootstrap.css 中定义,还有 text-lefttext-center 等。
    猜你喜欢
    • 2011-03-01
    • 2017-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-08
    • 2022-06-15
    相关资源
    最近更新 更多