New to Kendo UI for Angular? Start a free 30-day trial

Angular Data Grid Styling Columns

The Grid enables you to customize the appearance of the different column parts and change their default layout.

To apply custom styling to the columns of the Grid, you can customize these parts:

Customizing Column Header

You can add a custom CSS class or style to a column header by using the following ColumnComponent options:

  • headerClassSpecifies the class to be added to the header cell.
  • headerStyleSpecifies the styles to be added to the header cell.
Example
View Source
Change Theme:

Version 5.0.0 of the Grid introduced some breaking changes in the column header rendering of the sortable Grid. The main changes are:

  • The whole cell content is wrapped inside a <span> element with a k-cell-inner class;
  • The title text is wrapped inside a <span> element with a k-column-title class;
  • The whole cell content relies on CSS flexbox for positioning.

Due to these breaking changes, some scenarios require slightly different CSS rules for sortable and non-sortable Grid. For example, right align of header text:

    /* Sortable Grid */
    .k-cell-inner > .k-link {
        justify-content: flex-end;
    }

    /* Non-Sortable Grid */
    .k-grid th {
        text-align: right;
    }

You can set custom styles or add CSS classes to a column footer by using the following ColumnComponent options:

  • footerClassSpecifies the class to be added to the footer cell.
  • footerStyleSpecifies the styles to be added to the footer cell.

The following example demonstrates how to customize the footer appearance by using the footerClass and footerStyle properties.

Example
View Source
Change Theme:

Customizing Column Cells

You can add a custom CSS class or style to column cells by using the following ColumnComponent options:

  • classSpecifies the class to be added to the cell.
  • styleSpecifies the styles to be added to the cell.

The following example demonstrates how to customize the column cells by using the class and style properties.

Example
View Source
Change Theme: