The current version of Kendo UI no longer allows you to align column headings as described in the demo https://demos.telerik.com/kendo-ui/grid/cell-alignment
It occurs because a nested tag (k-link) is set as display: flex;
You can see an example of it on your own demo site (link above) - Ship City header should be centered but isn't.
{
field: "ShipCity",
title: "Ship City",
headerAttributes: { style: "text-align: center" },
attributes: { style: "text-align: right" }
}
Hello James,
This behavior is applicable to all Less themes and I recommend using the following:
{ field: "Freight", headerAttributes: { style: "text-align: center;" } }
...
dataBound: function(e) {
e.sender.element.find(".k-grid-header").find("thead th").each(function(i, el) {
$(el).find(".k-cell-inner").css("display", "inline-flex")
})
}
Dojo demo: https://dojo.telerik.com/UteWiHAz
The Less themes will be deprecated with the Kendo UI R1 2023 release, thus, I will not log this as a bug and I strongly recommend switching to Sass themes. Support for the Less themes will be discontinued in the very near future.
Let me know if you have any questions.
Regards,
Nikolay
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
I tracked the bug with interest and whilst I noticed that the claim to be fixed was made, it never worked for me.
I've just investigated why.
The problem is still present with the Bootstrap V3 theme even in your demo. There seems to be a difference between this theme and others.
Hi James,
I confirm this is a bug and you can track its progress at the following link:
A workaround at this time is applying the following style:
<style>
th.custom>.k-cell-inner>.k-link {
justify-content: right;
}
<style>
Here is a Dojo demo demonstrating this: https://dojo.telerik.com/uFivaSer
Regards,
Nikolay
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.