New to Telerik UI for ASP.NET MVC? Download free 30-day trial

ASP.NET MVC Grid Content Alignment

Loading Demo...

Also available for:



The Telerik UI for ASP.NET MVC Grid enables you to specify the alignment of its cell content in either of the following ways:

  • Through the column definition by using the HtmlAttributes() method—columns.Bound(o => o.ShipCity).HtmlAttributes(new { style = "text-align: right" });.
  • By applying the k-text-left, k-text-right, or k-text-center classes—columns.Bound(o => o.ShipCity).HtmlAttributes(new { @class = "k-text-right" });.
  • Also, you can update the alignment of the column header through the HeaderHtmlAttributes() method—columns.Bound(o => o.ShipCity).HeaderHtmlAttributes(new { style = "text-align: center; justify-content: center" });

    Additionally, the ASP.NET MVC Data Grid enables you to align its column footer by using the FooterHtmlAttributes() method—columns.Bound(o => o.Freight).FooterHtmlAttributes(new { style = "text-align: right" });.

    This demo shows how to change the alignment of the default column text and value in the ASP.NET MVC Data Grid.

    For more information about the approaches for taking the best out of the component, refer to the official Telerik UI for ASP.NET MVC Data Grid product documentation.

Additional Apps

This Grid example is part of a unique collection of hundreds of ASP.NET MVC demos, with which you can see all Telerik ASP.NET MVC components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in the ThemeBuilder.

Support & Learning Resources

Additional Resources