This is a migrated thread and some comments may be shown as answers.

Centering Data in a column

1 Answer 803 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 16 Mar 2019, 03:05 AM
I am porting a project that uses the ancient telerikMvcExtensions . I am looking for a replacement for column.Centered() .  I guess my question is how do we align data in a column or apply styles to it ? Would this be through Template or Client Template? If so, can i see an example. Thanks

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 18 Mar 2019, 01:16 PM
Hello Arun,

You can use one of these options to achieve this requirement:
columns.Bound(p => p.ShipName).HtmlAttributes(
    new { style = "text-align: center;", @class = "alternativeApproach" });

CSS:
<style>
    .alternativeApproach {
        text-align: center;
    }
</style>

I hope this will prove helpful

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Arun
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or