Articles in this section
Category / Section

How to Apply Custom Styles to the Blazor Pivot Table Headers?

2 mins read

Introduction

In certain scenarios, you may want to personalize the appearance of your header cells to enhance readability and improve the presentation of data. This article explains how to apply custom styles to the row and column headers of the Blazor Pivot Table component.

Customizing row and column headers

To customize the header styles of a pivot table, you can target the built-in CSS classes associated with the header cells of the pivot table. Here’s an example of how to change the background color and font family of both column and row headers.

[Index.razor]

<style>
    /* Customize the column headers here. */
    .e-pivotview .e-headercell { 
        background-color: thistle !important;
        font-family: cursive;
    } 
    
    /* Customize the row headers here. */
    .e-pivotview .e-rowsheader { 
        background-color: skyblue !important; 
        font-family: 'Franklin Gothic Medium';
    } 
</style>

In the above code snippet, target the CSS classes .e-headercell and .e-rowsheader within the .e-pivotview container. These classes represent the column headers and row headers, respectively. Inside the curly braces, you can define the styles that you want to apply. In this example, set the background-color property to thistle for the column headers and skyblue for the row headers. Additionally, you need to modify the font-family of the column header to cursive and the row header to Franklin Gothic Medium. By applying these styles, you can easily personalize the appearance of the pivot table headers.

The following screenshot illustrates the results of the above code snippet.

Screenshot

KB-15067.png

For a practical demonstration, refer to the Blazor Playground sample.

Conclusion:

We hope you enjoyed learning how to apply custom styles to the Blazor Pivot Table headers.

You can also refer to our Blazor Pivot Table feature tour page to learn about its other groundbreaking features, documentation, and how to quickly get started with configuration specifications. You can also explore our Blazor Pivot Table example to understand how to create and manipulate data.

For current customers, our Blazor components are available on the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to evaluate our Blazor Pivot Table and other Blazor components.

If you have any questions or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, support portal, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied