Align the Text of the PivotGrid to the Right
Environment
Product | Progress® Kendo UI® PivotGrid for jQuery |
Operating System | Windows 10 64bit |
Visual Studio Version | Visual Studio 2017 |
Preferred Language | JavaScript |
Description
How can I aling the text of the PivotGrid cells to the right?
Solution
The following example demonstrates how to right-align the text of data cells in a Kendo UI PivotGrid widget.
<style>
.k-pivot-table .k-grid-content td {
text-align: right;
}
</style>
<div id="example">
<div id="pivotgrid"></div>
<script>
$(document).ready(function () {
var pivotgrid = $("#pivotgrid").kendoPivotGrid({
filterable: true,
columnWidth: 200,
height: 580,
dataSource: {
type: "xmla",
columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ],
rows: [{ name: "[Geography].[City]" }],
measures: ["[Measures].[Internet Sales Amount]"],
transport: {
connection: {
catalog: "Adventure Works DW 2008R2",
cube: "Adventure Works"
},
read: "https://demos.telerik.com/olap/msmdpump.dll"
},
schema: {
type: "xmla"
},
error: function (e) {
alert("error: " + kendo.stringify(e.errors[0]));
}
}
}).data("kendoPivotGrid");
$("#configurator").kendoPivotConfigurator({
filterable: true,
dataSource: pivotgrid.dataSource
});
});
</script>
</div>