Search results

Text Alignment

The alignment of text inside row headers, column headers, value cells and summary cells can be changed using custom CSS setting. To do so, please refer the code sample below:

    @using Syncfusion.EJ2.Blazor.PivotView
    <EjsPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@dataSource">
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
                <PivotViewRow Name="Country" ></PivotViewRow>
                <PivotViewRow Name="Country" ></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
                <PivotViewValue Name="Sold" Caption="Units Sold"></PivotViewValue>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
                <PivotViewFormatSetting Name="Amount" Format="C"></PivotViewFormatSetting>


    //Value Cells
    .e-pivotview .e-valuescontent {
         text-align: center !important;

    //Columns Headers
    /*.e-pivotview .e-columnsheader {
         text-align: center !important;

    //Rows Headers
    .e-pivotview .e-rowsheader {
         text-align: center !important;

    //Summary Cells
    /* .e-pivotview .e-summary {
         text-align: center !important;


        public List<ProductDetails> data { get; set; }
        protected override void OnInitialized()
   = ProductDetails.GetProductData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.