Skip to main content

TableHeaderCell

<ui5-table-header-cell> | Since 2.0.0

The ui5-table-header-cell component represents a column in the ui5-table.

As it is tightly coupled to the ui5-table, it should only be used in the ui5-table-header-row to ensure correct layout and design.

ES6 Module Import

import "@ui5/webcomponents/dist/TableHeaderCell.js";

Properties

width

DescriptionDefines the width of the column.
By default, the column will grow and shrink according to the available space. This will distribute the space proportionally among all columns with no specific width set.
See <length> and <percentage> for possible width values.
Typestring | undefined
Defaultundefined

minWidth

DescriptionDefines the minimum width of the column.
If the table is in Popin mode and the minimum width does not fit anymore, the column will move into the popin.
By default, the table prevents the column from becoming too small. Changing this value to a small value might lead to accessibility issues.
Note: This property only takes effect for columns with a <percentage> value or the default width.
Typestring | undefined
Defaultundefined

importance

DescriptionDefines the importance of the column.
This property affects the popin behaviour. Columns with higher importance will move into the popin area later then less important columns.
Typenumber
Default0

popinText

DescriptionThe text for the column when it pops in.
Typestring | undefined
Defaultundefined
Since2.7.0

sortIndicator

DescriptionDefines the sort indicator of the column.
Type"None" | "Ascending" | "Descending"
Default"None"
Since2.8.0

popinHidden

DescriptionDefines if the column is hidden in the popin.
Note: Please be aware that hiding the column in the popin might lead to accessibility issues as users might not be able to access the content of the column on small screens.
Typeboolean
Defaultfalse
Since2.8.0

horizontalAlign

DescriptionDetermines the horizontal alignment of table cells.
Type"Left" | "Start" | "Right" | "End" | "Center" | undefined
Defaultundefined

Slots

action

DescriptionDefines the action of the column.
Note: While multiple actions are technically possible, this is not supported.
TypeArray<TableHeaderCellActionBase>
Since2.8.0

default

DescriptionDefines the content of the component.
TypeArray<Node>

Events

No events available for this component.

Methods

No methods available for this component.

CSS Parts

No CSS parts available for this component.

Column widths

You are able to set the width of the columns by using the width, minWidth and maxWidth property.

By default, columns will take up the available space if no width is defined. The ui5-table additionally ensures that the columns cannot become too small.

Popin Configuration

The Popin mode is a responsive design feature tailored to adapt column layouts in UI grids or tables, particularly for smaller screens or constrained container widths.

When screen space becomes limited, Popin mode seamlessly reorganizes columns. Those that cannot fit within the available width are intelligently relocated to the "popin area", an allocated space designed specifically for accommodating additional columns.

You can influence the order of columns appearing in the pop-in area by defining the importance of each column.

You can hide specific columns in the popin by using the popinHidden property on the ui5-table-header-cell. Note: Hiding columns in the popin leads to accessibility issues as information is lost on smaller screens.

Horizontal cell alignment

Controls the horizontal alignment of cells by using the horizontalAlign property.

Please note that the behavior of horizontalAlign depends on where you set it:

  • horizontalAlign is set on TableHeaderCell level
    Changes the horizontal alignment of the TableHeaderCell and its corresponding TableCell.
  • horizontalAlign is set on TableCell level only
    The horizontal alignment is only changed for this one TableCell
  • horizontalAlign is set on TableHeaderCell and TableCell level
    Changing the horizontalAlign property on TableHeaderCell level changes only the TableHeaderCell itself and those TableCell without a horizontalAlign property.